summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-08-16 00:37:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:51 -0500
commit622abf53f9de8a0230d71fcdb3724e1be31a2cc7 (patch)
treebd6976c2427aebabf6401816179cd0de72f43fa9
parent522418ce16f8d0af8dcf4673a795b42e14ea9e9c (diff)
downloadsamba-622abf53f9de8a0230d71fcdb3724e1be31a2cc7.tar.gz
samba-622abf53f9de8a0230d71fcdb3724e1be31a2cc7.tar.bz2
samba-622abf53f9de8a0230d71fcdb3724e1be31a2cc7.zip
r24476: Fix the mappings in reply_opeXXX calls. Now to test renames.
Jeremy. (This used to be commit 74d10b09a68f5c06d6b3ceffe0a40818dc84106e)
-rw-r--r--source3/smbd/reply.c31
-rw-r--r--source3/smbd/trans2.c4
2 files changed, 27 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 786fe9c6a1..1b0785285d 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1551,13 +1551,23 @@ void reply_open(connection_struct *conn, struct smb_request *req)
&info, &fsp);
if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBopen);
if (open_was_deferred(req->mid)) {
/* We have re-scheduled this call. */
- END_PROFILE(SMBopen);
+ return;
+ }
+ if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+ /*
+ * We hit an existing file, and if we're returning DOS
+ * error codes OBJECT_NAME_COLLISION would map to
+ * ERRDOS/183, we need to return ERRDOS/80, see bug
+ * 4852.
+ */
+ reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
+ ERRDOS, ERRfilexists);
return;
}
reply_nterror(req, status);
- END_PROFILE(SMBopen);
return;
}
@@ -1718,7 +1728,6 @@ void reply_open_and_X(connection_struct *conn, struct smb_request *req)
END_PROFILE(SMBopenX);
if (open_was_deferred(req->mid)) {
/* We have re-scheduled this call. */
- END_PROFILE(SMBopenX);
return;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
@@ -1730,11 +1739,9 @@ void reply_open_and_X(connection_struct *conn, struct smb_request *req)
*/
reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
ERRDOS, ERRfilexists);
- END_PROFILE(SMBopenX);
return;
}
reply_nterror(req, status);
- END_PROFILE(SMBopenX);
return;
}
@@ -2075,13 +2082,23 @@ void reply_ctemp(connection_struct *conn, struct smb_request *req)
close(tmpfd);
if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBctemp);
if (open_was_deferred(req->mid)) {
/* We have re-scheduled this call. */
- END_PROFILE(SMBctemp);
+ return;
+ }
+ if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+ /*
+ * We hit an existing file, and if we're returning DOS
+ * error codes OBJECT_NAME_COLLISION would map to
+ * ERRDOS/183, we need to return ERRDOS/80, see bug
+ * 4852.
+ */
+ reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
+ ERRDOS, ERRfilexists);
return;
}
reply_nterror(req, status);
- END_PROFILE(SMBctemp);
return;
}
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index a01e79b624..dbbb2faba9 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -6523,8 +6523,10 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
* ERRDOS/183, we need to return ERRDOS/80, see bug
* 4852.
*/
- return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+ reply_botherror(req,
+ NT_STATUS_OBJECT_NAME_COLLISION,
ERRDOS, ERRfilexists);
+ return;
}
reply_nterror(req, status);