Bug 10941 - dpkg no longer extracts symbolic links
Summary: dpkg no longer extracts symbolic links
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.28.x
Hardware: All Linux
: P5 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-13 08:49 UTC by Philip Munts
Modified: 2018-04-13 11:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
BusyBox .config (26.91 KB, application/octet-stream)
2018-04-13 08:49 UTC, Philip Munts
Details

Note You need to log in before you can comment on or make changes to this bug.
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