r24461: Fix Bug 4852, thank to anto <sistemac@prosoft.ba> for reporting it.
authorVolker Lendecke <vlendec@samba.org>
Wed, 15 Aug 2007 13:44:34 +0000 (13:44 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:29:49 +0000 (12:29 -0500)
(This used to be commit 0fecd8a0c3aaa64e137d2efd3f9cc7705837ea2a)

source3/smbd/reply.c

index a95f2ec87eec556bf046d2eb821a965d4716ae92..786fe9c6a16dfd521eff0be389be71bf58c7d952 100644 (file)
@@ -1718,9 +1718,23 @@ 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)) {
+                       /*
+                        * 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);
+                       END_PROFILE(SMBopenX);
                        return;
                }
                reply_nterror(req, status);
+               END_PROFILE(SMBopenX);
                return;
        }