From 14fc089bf52233278afc3ab886b07389960610d9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Feb 2005 20:55:48 +0000 Subject: [PATCH] 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) --- source3/smbd/nttrans.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 53fee175afd..f07fd8c25b5 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. */ -- 2.11.4.GIT