Author: jra
Date: 2007-07-18 01:27:03 +0000 (Wed, 18 Jul 2007)
New Revision: 23942

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

Log:
Fix issue found by Shlomi Yaakobovich <[EMAIL PROTECTED]> where
invalid names sent as a resume name were incorrectly mapped into
. and .. Ensure they really *are . and ..
Jeremy.

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


Changeset:
Modified: branches/SAMBA_3_0_25/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/trans2.c  2007-07-18 00:18:57 UTC (rev 
23941)
+++ branches/SAMBA_3_0_25/source/smbd/trans2.c  2007-07-18 01:27:03 UTC (rev 
23942)
@@ -1999,11 +1999,11 @@
                   complain (it thinks we're asking for the directory above the 
shared
                   path or an invalid name). Catch this as the resume name is 
only compared, never used in
                   a file access. JRA. */
-               if (NT_STATUS_EQUAL(ntstatus,NT_STATUS_OBJECT_PATH_SYNTAX_BAD)) 
{
-                       pstrcpy(resume_name, "..");
-               } else if 
(NT_STATUS_EQUAL(ntstatus,NT_STATUS_OBJECT_NAME_INVALID)) {
-                       pstrcpy(resume_name, ".");
-               } else {
+               srvstr_pull(inbuf, resume_name, params+12,
+                                       sizeof(resume_name), total_params - 12,
+                                       STR_TERMINATE);
+
+               if (!(ISDOT(resume_name) || ISDOTDOT(resume_name))) {
                        return ERROR_NT(ntstatus);
                }
        }

Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/trans2.c     2007-07-18 00:18:57 UTC (rev 
23941)
+++ branches/SAMBA_3_2/source/smbd/trans2.c     2007-07-18 01:27:03 UTC (rev 
23942)
@@ -2024,11 +2024,12 @@
                   complain (it thinks we're asking for the directory above the 
shared
                   path or an invalid name). Catch this as the resume name is 
only compared, never used in
                   a file access. JRA. */
-               if (NT_STATUS_EQUAL(ntstatus,NT_STATUS_OBJECT_PATH_SYNTAX_BAD)) 
{
-                       pstrcpy(resume_name, "..");
-               } else if 
(NT_STATUS_EQUAL(ntstatus,NT_STATUS_OBJECT_NAME_INVALID)) {
-                       pstrcpy(resume_name, ".");
-               } else {
+               srvstr_pull(inbuf, SVAL(inbuf,smb_flg2),
+                               resume_name, params+12,
+                               sizeof(resume_name), total_params - 12,
+                               STR_TERMINATE);
+
+               if (!(ISDOT(resume_name) || ISDOTDOT(resume_name))) {
                        return ERROR_NT(ntstatus);
                }
        }

Modified: branches/SAMBA_3_2_0/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/trans2.c   2007-07-18 00:18:57 UTC (rev 
23941)
+++ branches/SAMBA_3_2_0/source/smbd/trans2.c   2007-07-18 01:27:03 UTC (rev 
23942)
@@ -2008,11 +2008,12 @@
                   complain (it thinks we're asking for the directory above the 
shared
                   path or an invalid name). Catch this as the resume name is 
only compared, never used in
                   a file access. JRA. */
-               if (NT_STATUS_EQUAL(ntstatus,NT_STATUS_OBJECT_PATH_SYNTAX_BAD)) 
{
-                       pstrcpy(resume_name, "..");
-               } else if 
(NT_STATUS_EQUAL(ntstatus,NT_STATUS_OBJECT_NAME_INVALID)) {
-                       pstrcpy(resume_name, ".");
-               } else {
+               srvstr_pull(inbuf, SVAL(inbuf,smb_flg2),
+                               resume_name, params+12,
+                               sizeof(resume_name), total_params - 12,
+                               STR_TERMINATE);
+
+               if (!(ISDOT(resume_name) || ISDOTDOT(resume_name))) {
                        return ERROR_NT(ntstatus);
                }
        }

Reply via email to