summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-25 22:37:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:03 -0500
commitefd2a065947547c46d0d62fb7fe1114935613311 (patch)
tree06fb5bbd3b91f33b3be6e0cec4151ef4cf79376c /source3
parent073c542c5135d78f0ff5755ed62daf230292cec0 (diff)
downloadsamba-efd2a065947547c46d0d62fb7fe1114935613311.tar.gz
samba-efd2a065947547c46d0d62fb7fe1114935613311.tar.bz2
samba-efd2a065947547c46d0d62fb7fe1114935613311.zip
r1257: Ensure we deferr a sharing violation on rename correctly.
Jeremy. (This used to be commit b52a04a5cdcea83c99805181241c8c0760bcc22e)
Diffstat (limited to 'source3')
-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 2f498b7c94..3e5b07b887 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1555,8 +1555,13 @@ int reply_ntrename(connection_struct *conn,
return ERROR_NT(NT_STATUS_ACCESS_DENIED);
}
+ if (ms_has_wild(oldname)) {
+ END_PROFILE(SMBntrename);
+ return ERROR_NT(NT_STATUS_OBJECT_PATH_SYNTAX_BAD);
+ }
+
p++;
- p += srvstr_get_path(inbuf, newname, p, sizeof(newname), 0, STR_TERMINATE, &status, True);
+ p += srvstr_get_path(inbuf, newname, p, sizeof(newname), 0, STR_TERMINATE, &status, False);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBntrename);
return ERROR_NT(status);
@@ -1575,6 +1580,11 @@ int reply_ntrename(connection_struct *conn,
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBntrename);
+ if (open_was_deferred(SVAL(inbuf,smb_mid))) {
+ /* We have re-scheduled this call. */
+ clear_cached_errors();
+ return -1;
+ }
return ERROR_NT(status);
}