summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-01-18 06:19:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:16 -0500
commitfd37f98158161406229b728a7c767121a30e254f (patch)
treebcc2ecea864702f61d56ccb1e2b10f7fa3672cc6 /source3/smbd/open.c
parenta99840e59ee4bd27fd4f2cf8b465dd0f215ea067 (diff)
downloadsamba-fd37f98158161406229b728a7c767121a30e254f.tar.gz
samba-fd37f98158161406229b728a7c767121a30e254f.tar.bz2
samba-fd37f98158161406229b728a7c767121a30e254f.zip
r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.
Allow us to correctly refuse to set delete on close on a non-empty directory. There are still some delete-on-close wrinkles to be fixed, but I understand how to do that better now. I'll fix this tomorrow. Jeremy. (This used to be commit 029635885825a5562e7974a6f5675cce3bf1b5dc)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 4249c6e85b..c0638c0039 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2110,15 +2110,17 @@ NTSTATUS open_directory(connection_struct *conn,
always to be honored on close... See test 19 in Samba4 BASE-DELETE. */
if (create_options & FILE_DELETE_ON_CLOSE) {
status = can_set_delete_on_close(fsp, True, 0);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_DIRECTORY_NOT_EMPTY)) {
TALLOC_FREE(lck);
file_free(fsp);
return status;
}
- set_delete_on_close_token(lck, &current_user.ut);
- lck->initial_delete_on_close = True;
- lck->modified = True;
+ if (NT_STATUS_IS_OK(status)) {
+ set_delete_on_close_token(lck, &current_user.ut);
+ lck->initial_delete_on_close = True;
+ lck->modified = True;
+ }
}
TALLOC_FREE(lck);