Author: vlendec
Date: 2007-08-15 13:44:34 +0000 (Wed, 15 Aug 2007)
New Revision: 24461

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24461

Log:
Fix Bug 4852, thank to anto <[EMAIL PROTECTED]> for reporting it.

Modified:
   branches/SAMBA_3_0_25/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/reply.c   2007-08-15 13:44:33 UTC (rev 
24460)
+++ branches/SAMBA_3_0_25/source/smbd/reply.c   2007-08-15 13:44:34 UTC (rev 
24461)
@@ -1455,6 +1455,16 @@
                        /* We have re-scheduled this call. */
                        return -1;
                }
+               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.
+                        */
+                       return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+                                         ERRDOS, ERRfilexists);
+               }
                return ERROR_NT(status);
        }
 

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/reply.c      2007-08-15 13:44:33 UTC (rev 
24460)
+++ branches/SAMBA_3_2/source/smbd/reply.c      2007-08-15 13:44:34 UTC (rev 
24461)
@@ -1718,9 +1718,23 @@
                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;
        }
 

Modified: branches/SAMBA_3_2_0/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/reply.c    2007-08-15 13:44:33 UTC (rev 
24460)
+++ branches/SAMBA_3_2_0/source/smbd/reply.c    2007-08-15 13:44:34 UTC (rev 
24461)
@@ -1505,6 +1505,16 @@
                        /* We have re-scheduled this call. */
                        return -1;
                }
+               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.
+                        */
+                       return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+                                         ERRDOS, ERRfilexists);
+               }
                return ERROR_NT(status);
        }
 

Reply via email to