cpio: extract "unsafe" symlinks the same way tar/unzip does
authorNatanael Copa <ncopa@alpinelinux.org>
Fri, 30 Mar 2018 18:18:12 +0000 (20:18 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Apr 2018 11:04:11 +0000 (13:04 +0200)
function                                             old     new   delta
cpio_main                                            588     596      +8

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/cpio.c

index 1d6cbd1e29934f58c05b12c1a1b200825c49510a..308ec1b254dd446823868f7b4a82bc0af00857b1 100644 (file)
@@ -508,6 +508,8 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
        while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
                continue;
 
+       create_symlinks_from_list(archive_handle->symlink_placeholders);
+
        if (archive_handle->cpio__blocks != (off_t)-1
         && !(opt & OPT_QUIET)
        ) {