summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-11 14:21:09 -0800
committerJeremy Allison <jra@samba.org>2008-11-11 14:21:09 -0800
commit0baca66589d72acf7b3d6edf7c7d21fa17f98915 (patch)
tree6d70d255fcca5b355485bb7dd0917b1d5d7f903a /source3
parent4f2635b729e636e123afacb0970c3d49343b3e90 (diff)
downloadsamba-0baca66589d72acf7b3d6edf7c7d21fa17f98915.tar.gz
samba-0baca66589d72acf7b3d6edf7c7d21fa17f98915.tar.bz2
samba-0baca66589d72acf7b3d6edf7c7d21fa17f98915.zip
Fix bug 5889. "delete veto files = no" seems to break.
Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/reply.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index be39fd464d..c363ed5609 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -4989,8 +4989,16 @@ NTSTATUS rmdir_internals(TALLOC_CTX *ctx,
}
}
- /* We only have veto files/directories. Recursive delete. */
+ /* We only have veto files/directories.
+ * Are we allowed to delete them ? */
+ if(!lp_recursive_veto_delete(SNUM(conn))) {
+ TALLOC_FREE(dir_hnd);
+ errno = ENOTEMPTY;
+ goto err;
+ }
+
+ /* Do a recursive delete. */
RewindDir(dir_hnd,&dirpos);
while ((dname = ReadDirName(dir_hnd,&dirpos))) {
char *fullname = NULL;
@@ -5016,9 +5024,8 @@ NTSTATUS rmdir_internals(TALLOC_CTX *ctx,
break;
}
if(st.st_mode & S_IFDIR) {
- if(lp_recursive_veto_delete(SNUM(conn))) {
- if(!recursive_rmdir(ctx, conn, fullname))
- break;
+ if(!recursive_rmdir(ctx, conn, fullname)) {
+ break;
}
if(SMB_VFS_RMDIR(conn,fullname) != 0) {
break;