Skip to content

Commit

Permalink
busybox: libarchive: Fix matchpathcon_init use of libselinux
Browse files Browse the repository at this point in the history
 * Provide the /file_contexts path to libselinux

 * Avoids a SIGSEGV upon cpio extraction due to a NULL
    file_contexts input, which fails down the layers
    of libselinux upon strdup of the path

Change-Id: Ic8a8e8a461c0433144af15d48d2ce7299be84152
Signed-off-by: Adrian DC <radian.dc@gmail.com>
  • Loading branch information
AdrianDC authored and mdmower committed Mar 11, 2017
1 parent a0c192d commit 133e252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion archival/libarchive/data_extract_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
#if ENABLE_FEATURE_TAR_SELINUX
char *sctx = archive_handle->tar__sctx[PAX_NEXT_FILE];
#ifdef __BIONIC__
matchpathcon_init(NULL);
matchpathcon_init("/file_contexts");
#endif
if (!sctx)
sctx = archive_handle->tar__sctx[PAX_GLOBAL];
Expand Down

0 comments on commit 133e252

Please sign in to comment.