r24475: Fix the error mapping for SMB_POSIX_PATH_OPEN.
authorJeremy Allison <jra@samba.org>
Thu, 16 Aug 2007 00:22:35 +0000 (00:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:29:51 +0000 (12:29 -0500)
Jeremy.

source/smbd/trans2.c

index 355c040a1c158338f3171342a61de6fa9393180d..a01e79b6243dce064736765f45caa440e88ac7cd 100644 (file)
@@ -6515,6 +6515,18 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
                                        ERRSRV, ERRbadpath);
                        return;
                }
+               if (info_level == SMB_POSIX_PATH_OPEN &&
+                       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.
+                                */
+                               return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+                                       ERRDOS, ERRfilexists);
+               }
+
                reply_nterror(req, status);
                return;
        }