diff options
author | Jeremy Allison <jra@samba.org> | 2005-02-22 20:55:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:43 -0500 |
commit | 14fc089bf52233278afc3ab886b07389960610d9 (patch) | |
tree | e342f6e57d95186f0280cac1c4f612aaf4b89884 /source3 | |
parent | fcbb7b0e25ae22bd8fb04918cf1c5af44a06ca19 (diff) | |
download | samba-14fc089bf52233278afc3ab886b07389960610d9.tar.gz samba-14fc089bf52233278afc3ab886b07389960610d9.tar.bz2 samba-14fc089bf52233278afc3ab886b07389960610d9.zip |
r5510: Optimisation to only do can_delete check if client asks for FILE_SHARE_DELETE.
Not completely correct but will catch the XP SP2 problem.
Jeremy.
(This used to be commit 1e2d0fcdbb72735f8b53d9faaec07d711ae236d0)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/nttrans.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 53fee175af..f07fd8c25b 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -780,7 +780,16 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib } } +#if 0 + /* This is the correct thing to do (check every time) but can_delete is + expensive (it may have to read the parent directory permissions). So + for now we're not doing it unless we have a strong hint the client + is really going to delete this file. */ if (desired_access & DELETE_ACCESS) { +#else + /* Setting FILE_SHARE_DELETE is the hint. */ + if ((share_access & FILE_SHARE_DELETE) && (desired_access & DELETE_ACCESS)) { +#endif status = can_delete(conn, fname, file_attributes, bad_path, True); /* We're only going to fail here if it's access denied, as that's the only error we care about for "can we delete this ?" questions. */ |