1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: lib: Fix canonicalize_absolute_path() to pass the tests from resolve_realpath_name()

Remove the knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2020-04-21 12:58:02 -07:00 committed by Ralph Boehme
parent 9cea0cc5b5
commit d01e11cf26
2 changed files with 13 additions and 3 deletions

View File

@ -1,2 +0,0 @@
samba3.smbtorture_s3.LOCAL-CANONICALIZE-PATH

View File

@ -130,7 +130,13 @@ char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path)
s++;
}
if ((d > destname + 1) && (*s != '\0')) {
*d++ = '/';
if (!start_of_name_component) {
/*
* Only write a / if we
* haven't just written one.
*/
*d++ = '/';
}
}
start_of_name_component = true;
continue;
@ -178,6 +184,12 @@ char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path)
continue;
}
/*
* Step forward one to leave the
* last written '/' alone.
*/
d++;
/*
* We're still at the start of a name
* component, just the previous one.