summaryrefslogtreecommitdiff
path: root/source4/libcli/smb2
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-09-23 15:16:46 +1000
committerAndrew Tridgell <tridge@samba.org>2008-09-23 15:16:46 +1000
commit2b6e139206e5f436dd51437599d0228d8db77a78 (patch)
treece85faa6e51de09fafcbbbd5975ca82714fa246a /source4/libcli/smb2
parentf4e212323fb7ba2bd226194287602210aa9590ec (diff)
downloadsamba-2b6e139206e5f436dd51437599d0228d8db77a78.tar.gz
samba-2b6e139206e5f436dd51437599d0228d8db77a78.tar.bz2
samba-2b6e139206e5f436dd51437599d0228d8db77a78.zip
fixed readonly handling in deltree
Diffstat (limited to 'source4/libcli/smb2')
-rw-r--r--source4/libcli/smb2/util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/smb2/util.c b/source4/libcli/smb2/util.c
index 311cea94a0..b149b3d6ce 100644
--- a/source4/libcli/smb2/util.c
+++ b/source4/libcli/smb2/util.c
@@ -197,6 +197,12 @@ int smb2_deltree(struct smb2_tree *tree, const char *dname)
smb2_util_close(tree, create_parm.out.file.handle);
status = smb2_util_rmdir(tree, dname);
+ 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_rmdir(tree, dname);
+ }
+
if (NT_STATUS_IS_ERR(status)) {
DEBUG(2,("Failed to delete %s - %s\n",
dname, nt_errstr(status)));