]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5813: Fix bug found by Jim McDonough <jmcd@us.ibm.com>
authorJeremy Allison <jra@samba.org>
Tue, 15 Mar 2005 23:40:47 +0000 (23:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:03 +0000 (10:56 -0500)
Win9x can send a resume name of "..". This will cause the parser to
complain (it thinks we're asking for the directory above the shared
path). Catch this as the resume name is only compared, never used in
a file access and replace it with "..".
Jeremy.

source/smbd/trans2.c

index 3f3d9c2f461fa33975116b9d24c6050bc6c7f336..c21fe1113ec51e5d6a4e0ba52c9bc87549990dd4 100644 (file)
@@ -1569,7 +1569,15 @@ static int call_trans2findnext(connection_struct *conn, char *inbuf, char *outbu
 
        srvstr_get_path(inbuf, resume_name, params+12, sizeof(resume_name), -1, STR_TERMINATE, &ntstatus, True);
        if (!NT_STATUS_IS_OK(ntstatus)) {
-               return ERROR_NT(ntstatus);
+               /* Win9x can send a resume name of "..". This will cause the parser to
+                  complain (it thinks we're asking for the directory above the shared
+                  path). Catch this as the resume name is only compared, never used in
+                  a file access. JRA. */
+               if (NT_STATUS_V(ntstatus) == NT_STATUS_V(NT_STATUS_OBJECT_PATH_SYNTAX_BAD)) {
+                       pstrcpy(resume_name, "..");
+               } else {
+                       return ERROR_NT(ntstatus);
+               }
        }
 
        DEBUG(3,("call_trans2findnext: dirhandle = %d, max_data_bytes = %d, maxentries = %d, \