summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-02-24 01:03:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:45 -0500
commitcb203b2d1ec1eec67c3b9347c59230504c68d0b7 (patch)
tree820c7000a1cd4206de37f811c4f268af7672a37d
parent051d9d7894662d59af1b71d2ea36910d7aac5f38 (diff)
downloadsamba-cb203b2d1ec1eec67c3b9347c59230504c68d0b7.tar.gz
samba-cb203b2d1ec1eec67c3b9347c59230504c68d0b7.tar.bz2
samba-cb203b2d1ec1eec67c3b9347c59230504c68d0b7.zip
r5530: Keep the TRANS call up to date with the NTCreateX call.
Jeremy. (This used to be commit 98a07e1520d6fb1f6f5320bc70ac33d4c5052ea6)
-rw-r--r--source3/smbd/nttrans.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 2bb2198574..d0d5ddf871 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1340,11 +1340,21 @@ static int call_nt_transact_create(connection_struct *conn, char *inbuf, char *o
return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath);
}
+#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. */
- if (!NT_STATUS_IS_OK(status) && NT_STATUS_EQUAL(status,NT_STATUS_ACCESS_DENIED)) {
+ if (!NT_STATUS_IS_OK(status) && (NT_STATUS_EQUAL(status,NT_STATUS_ACCESS_DENIED) ||
+ NT_STATUS_EQUAL(status,NT_STATUS_CANNOT_DELETE))) {
restore_case_semantics(conn, file_attributes);
END_PROFILE(SMBntcreateX);
return ERROR_NT(status);