]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r23942: Fix issue found by Shlomi Yaakobovich <Shlomi@exanet.com> where
authorJeremy Allison <jra@samba.org>
Wed, 18 Jul 2007 01:27:03 +0000 (01:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:28:47 +0000 (12:28 -0500)
invalid names sent as a resume name were incorrectly mapped into
. and .. Ensure they really *are . and ..
Jeremy.
(This used to be commit 78d0c5194fe42ad4f096657e2210a15541303a2a)

source3/smbd/trans2.c

index 2d7d96e8b3f76aa8ce50caf8df7cb79b97cb771c..18b51ab56c3292b0b701e0633214c7d8356e219f 100644 (file)
@@ -2024,11 +2024,12 @@ static int call_trans2findnext(connection_struct *conn, char *inbuf, char *outbu
                   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);
                }
        }