1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

cope better with read only files in smb2_deltree

(This used to be commit 88a2c7b2f44f160836e477e460812df557204f51)
This commit is contained in:
Andrew Tridgell 2008-05-27 14:06:27 +10:00
parent 892712e4e7
commit 9691856569

View File

@ -127,6 +127,16 @@ int smb2_deltree(struct smb2_tree *tree, const char *dname)
return 0;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_CANNOT_DELETE)) {
/* it could be read-only */
status = smb2_util_setatr(tree, dname, FILE_ATTRIBUTE_NORMAL);
status = smb2_util_unlink(tree, dname);
}
if (NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
return 1;
}
ZERO_STRUCT(create_parm);
create_parm.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
create_parm.in.share_access =