diff options
| author | Tim Kientzle <kientzle@FreeBSD.org> | 2008-08-24 05:42:22 +0000 |
|---|---|---|
| committer | Tim Kientzle <kientzle@FreeBSD.org> | 2008-08-24 05:42:22 +0000 |
| commit | b9364a48e5a81d401f208b0354e8c6ac46c69cfd (patch) | |
| tree | 43ef05926bcbc818cce8eeecd478fcd23dcf0699 /lib/libarchive/archive_write_disk.c | |
| parent | 47317d6e6d20335371d70a26b420c3e4c4832191 (diff) | |
Notes
Diffstat (limited to 'lib/libarchive/archive_write_disk.c')
| -rw-r--r-- | lib/libarchive/archive_write_disk.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/libarchive/archive_write_disk.c b/lib/libarchive/archive_write_disk.c index 3fdea0e5bdf9..1bed32378869 100644 --- a/lib/libarchive/archive_write_disk.c +++ b/lib/libarchive/archive_write_disk.c @@ -1350,7 +1350,6 @@ cleanup_pathname(struct archive_write_disk *a) { char *dest, *src; char separator = '\0'; - int lastdotdot = 0; /* True if last elt copied was '..' */ dest = src = a->name; if (*src == '\0') { @@ -1389,9 +1388,7 @@ cleanup_pathname(struct archive_write_disk *a) "Path contains '..'"); return (ARCHIVE_FAILED); } - lastdotdot = 1; - } else - lastdotdot = 0; + } /* * Note: Under no circumstances do we * remove '..' elements. In @@ -1399,10 +1396,8 @@ cleanup_pathname(struct archive_write_disk *a) * '/foo/../bar/' should create the * 'foo' dir as a side-effect. */ - } else - lastdotdot = 0; - } else - lastdotdot = 0; + } + } /* Copy current element, including leading '/'. */ if (separator) @@ -1421,13 +1416,6 @@ cleanup_pathname(struct archive_write_disk *a) * We've just copied zero or more path elements, not including the * final '/'. */ - if (lastdotdot) { - /* Trailing '..' is always wrong. */ - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Path contains trailing '..'"); - return (ARCHIVE_FAILED); - } if (dest == a->name) { /* * Nothing got copied. The path must have been something |
