mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-04-25 19:10:46 +00:00
--one-top-level now keeps "../" and ".../"
* src/list.c (enforce_one_top_level): Do not strip prefixes like "../" (which should not be allowed unless -P) and ".../" (which are ordinary file names). The "../" not being allowed should be addressed in a different way.
This commit is contained in:
12
src/list.c
12
src/list.c
@@ -120,8 +120,16 @@ enforce_one_top_level (char **pfile_name)
|
||||
char *file_name = *pfile_name;
|
||||
char *p;
|
||||
|
||||
for (p = file_name; *p && (ISSLASH (*p) || *p == '.'); p++)
|
||||
;
|
||||
for (p = file_name; ; p++)
|
||||
{
|
||||
bool dot = p[0] == '.';
|
||||
if (!ISSLASH (p[dot]))
|
||||
{
|
||||
p += dot & !p[dot];
|
||||
break;
|
||||
}
|
||||
p += dot;
|
||||
}
|
||||
|
||||
if (*p)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user