diff options
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/archival/tar.c b/archival/tar.c index 74d6fca91..52f3c364c 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -397,17 +397,8 @@ static int FAST_FUNC writeFileToTarball(const char *fileName, struct stat *statb | |||
397 | 397 | ||
398 | DBG("writeFileToTarball('%s')", fileName); | 398 | DBG("writeFileToTarball('%s')", fileName); |
399 | 399 | ||
400 | /* Strip leading '/' (must be before memorizing hardlink's name) */ | 400 | /* Strip leading '/' and such (must be before memorizing hardlink's name) */ |
401 | header_name = fileName; | 401 | header_name = strip_unsafe_prefix(fileName); |
402 | while (header_name[0] == '/') { | ||
403 | static smallint warned; | ||
404 | |||
405 | if (!warned) { | ||
406 | bb_error_msg("removing leading '/' from member names"); | ||
407 | warned = 1; | ||
408 | } | ||
409 | header_name++; | ||
410 | } | ||
411 | 402 | ||
412 | if (header_name[0] == '\0') | 403 | if (header_name[0] == '\0') |
413 | return TRUE; | 404 | return TRUE; |
@@ -981,6 +972,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
981 | putenv((char*)"TAR_FILETYPE=f"); | 972 | putenv((char*)"TAR_FILETYPE=f"); |
982 | signal(SIGPIPE, SIG_IGN); | 973 | signal(SIGPIPE, SIG_IGN); |
983 | tar_handle->action_data = data_extract_to_command; | 974 | tar_handle->action_data = data_extract_to_command; |
975 | IF_FEATURE_TAR_TO_COMMAND(tar_handle->tar__to_command_shell = xstrdup(get_shell_name());) | ||
984 | } | 976 | } |
985 | 977 | ||
986 | if (opt & OPT_KEEP_OLD) | 978 | if (opt & OPT_KEEP_OLD) |