Bug 10941

Summary: dpkg no longer extracts symbolic links
Product: Busybox Reporter: Philip Munts <phil>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: critical CC: busybox-cvs
Priority: P5    
Version: 1.28.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: BusyBox .config

Description Philip Munts 2018-04-13 08:49:19 UTC
Created attachment 7561 [details]
BusyBox .config

With BusyBox 1.28.3, if I attempt to install a Debian package with dpkg that contains symbolic links in data.tar.gz, they are not extracted.  Doesn't matter whether the links are relative or absolute.

If I manually extract data.tar.gz with ar and then unpack it with tar xzf, the symbolic links are created properly.

This is an absolute show stopper for me, as I am creating custom packages of third party software (such as Mono) that contain symbolic links.
Comment 1 Denys Vlasenko 2018-04-13 09:32:44 UTC
Does this patch fix it?

--- a/archival/libarchive/get_header_ar.c
+++ b/archival/libarchive/get_header_ar.c
@@ -127,8 +127,10 @@ char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
                archive_handle->action_header(typed);
 #if ENABLE_DPKG || ENABLE_DPKG_DEB
                if (archive_handle->dpkg__sub_archive) {
-                       while (archive_handle->dpkg__action_data_subarchive(archive_handle->dpkg__sub_archive) == EXIT_SUCCESS)
+                       struct archive_handle_t *sa = archive_handle->dpkg__sub_archive;
+                       while (archive_handle->dpkg__action_data_subarchive(sa) == EXIT_SUCCESS)
                                continue;
+                       create_symlinks_from_list(sa->symlink_placeholders);
                } else
 #endif
                        archive_handle->action_data(archive_handle);
Comment 2 Philip Munts 2018-04-13 10:52:47 UTC
Yes, that seems to fix it.
Comment 3 Denys Vlasenko 2018-04-13 11:28:36 UTC
Fixed in git