summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-05-27 14:06:27 +1000
committerAndrew Tridgell <tridge@samba.org>2008-05-27 14:06:27 +1000
commit9691856569e2fdbcbd8c05a2cf3155263b8fa410 (patch)
tree99d9804ec9cd1fa8d68f70a3ffa8beb36f3fb190
parent892712e4e77abbc4ec7b18623eb1cba86f7a2979 (diff)
downloadsamba-9691856569e2fdbcbd8c05a2cf3155263b8fa410.tar.gz
samba-9691856569e2fdbcbd8c05a2cf3155263b8fa410.tar.bz2
samba-9691856569e2fdbcbd8c05a2cf3155263b8fa410.zip
cope better with read only files in smb2_deltree
(This used to be commit 88a2c7b2f44f160836e477e460812df557204f51)
-rw-r--r--source4/libcli/smb2/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/libcli/smb2/util.c b/source4/libcli/smb2/util.c
index 9eb344e83f..311cea94a0 100644
--- a/source4/libcli/smb2/util.c
+++ b/source4/libcli/smb2/util.c
@@ -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 =