r13299: From testing W2K3 and W2K the delete on close bit seems to be always
authorJeremy Allison <jra@samba.org>
Fri, 3 Feb 2006 02:16:35 +0000 (02:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:06:22 +0000 (11:06 -0500)
honored (ie. the file gets deleted) for derectories when set at open
time - even though it doesn't show in the qfileinfo call. This is not
true of files.... (if anyone from the EU is listening, it's stuff like
this that makes CIFS non-documentable :-).
Jeremy.

source/smbd/open.c

index 15e814aae3c9d598a34a1034c92ab2c9fabaeb40..f75bc55b46cae29459e7a4855d6f3391d66626e1 100644 (file)
@@ -1973,9 +1973,9 @@ files_struct *open_directory(connection_struct *conn,
 
        set_share_mode(lck, fsp, 0, NO_OPLOCK);
 
-       if ((create_options & FILE_DELETE_ON_CLOSE) &&
-                       (info == FILE_WAS_OVERWRITTEN || info == FILE_WAS_CREATED ||
-                       info == FILE_WAS_SUPERSEDED)) {
+       /* For directories the delete on close bit at open time seems
+          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)) {
                        set_saved_ntstatus(status);