summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-01-18 21:51:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:18 -0500
commitc9a14ea19f812d86266bfa9e6ce8b32f7b4ff19f (patch)
tree25357b5866e8786e6a685163a02315d0d53921a8 /source3/smbd/open.c
parent9d19e5294042e4de2c0eb70ee8b17993ebce211d (diff)
downloadsamba-c9a14ea19f812d86266bfa9e6ce8b32f7b4ff19f.tar.gz
samba-c9a14ea19f812d86266bfa9e6ce8b32f7b4ff19f.tar.bz2
samba-c9a14ea19f812d86266bfa9e6ce8b32f7b4ff19f.zip
r20883: W00t! I now understand how "delete on close" really
works - even with the strange "initial delete on close" semantics. The "initial delete on close" flag isn't committed to the share mode db until the handle is closed, and is discarded if any real "delete on close" was set. This allows me to remove the "initial_delete_on_close" flag from the share db, and move it into a BOOL in files_struct. Warning ! You must do a make clean after this. Cope with the wrinkle in directory delete on close which is done differently from files. We now pass all Samba4 smbtortute BASE-DELETE tests except for the one checking that files can't be created in a directory which has the delete on close set (possibly expensive to fix). Jeremy. (This used to be commit f2df77a1497958c1ea791f1d2f4446b5fc3389b3)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index c0638c0039..a5a8eacda0 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1761,10 +1761,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
return status;
}
/* Note that here we set the *inital* delete on close flag,
- not the regular one. */
- set_delete_on_close_token(lck, &current_user.ut);
- lck->initial_delete_on_close = True;
- lck->modified = True;
+ not the regular one. The magic gets handled in close. */
+ fsp->initial_delete_on_close = True;
}
/* Files should be initially set as archive */
@@ -2117,9 +2115,9 @@ NTSTATUS open_directory(connection_struct *conn,
}
if (NT_STATUS_IS_OK(status)) {
- set_delete_on_close_token(lck, &current_user.ut);
- lck->initial_delete_on_close = True;
- lck->modified = True;
+ /* Note that here we set the *inital* delete on close flag,
+ not the regular one. The magic gets handled in close. */
+ fsp->initial_delete_on_close = True;
}
}