git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c73dd07
)
cope better with read only files in smb2_deltree
author
Andrew Tridgell
<tridge@samba.org>
Tue, 27 May 2008 04:06:27 +0000
(14:06 +1000)
committer
Andrew Tridgell
<tridge@samba.org>
Tue, 27 May 2008 04:06:27 +0000
(14:06 +1000)
source/libcli/smb2/util.c
patch
|
blob
|
history
diff --git
a/source/libcli/smb2/util.c
b/source/libcli/smb2/util.c
index 9eb344e83fdc5ef0058e575467027c01e2423190..311cea94a085a1494e49c8b7dd67d6bedf032de8 100644
(file)
--- a/
source/libcli/smb2/util.c
+++ b/
source/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 =