]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: torture: Add the tests from resolve_realpath_name() to canonicalize_absolute_path().
authorJeremy Allison <jra@samba.org>
Tue, 21 Apr 2020 18:49:44 +0000 (11:49 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 22 Apr 2020 08:15:35 +0000 (08:15 +0000)
canonicalize_absolute_path() has a bug.

In canonicalize_absolute_path()

///a/./././///component/../////path/ -> /a//path

It should go to /a/path. Mark as knownfail.

Adding these tests so I can ultimately remove
resolve_realpath_name() and re-use the existing
canonicalize_absolute_path() code in vfs_widelinks.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
selftest/knownfail.d/local_canonicalize_path [new file with mode: 0644]
source3/torture/torture.c

diff --git a/selftest/knownfail.d/local_canonicalize_path b/selftest/knownfail.d/local_canonicalize_path
new file mode 100644 (file)
index 0000000..477c60a
--- /dev/null
@@ -0,0 +1,2 @@
+samba3.smbtorture_s3.LOCAL-CANONICALIZE-PATH
+
index c3f387cd0e258c042ac7e63c39558c865e99696e..aa02163636e7efd81eb0ea05d48a9fbf862a401f 100644 (file)
@@ -14066,6 +14066,25 @@ static bool run_local_canonicalize_path(int dummy)
                        ".././././",
                        ".././././../../../boo",
                        "./..",
+                       "/",
+                       "/../../",
+                       "/foo/../",
+                       "/./././",
+                       "/./././.",
+                       "/.../././.",
+                       "/./././.foo",
+                       "/./././.foo.",
+                       "/./././foo.",
+                       "/foo/bar/..",
+                       "/foo/bar/../baz/",
+                       "////////////////",
+                       "/////////./././././.",
+                       "/./.././../.boo/../baz",
+                       "/a/component/path",
+                       "/a/component/path/",
+                       "/a/component/path/..",
+                       "/a/component/../path/",
+                       "///a/./././///component/../////path/",
                        NULL
                        };
        const char *dst[] = {
@@ -14077,6 +14096,25 @@ static bool run_local_canonicalize_path(int dummy)
                        "/",
                        "/boo",
                        "/",
+                       "/",
+                       "/",
+                       "/",
+                       "/",
+                       "/",
+                       "/...",
+                       "/.foo",
+                       "/.foo.",
+                       "/foo.",
+                       "/foo",
+                       "/foo/baz",
+                       "/",
+                       "/",
+                       "/baz",
+                       "/a/component/path",
+                       "/a/component/path",
+                       "/a/component",
+                       "/a/path",
+                       "/a/path",
                        NULL
                        };
        unsigned int i;