support xattr when extracting packages

This permits storing the result of setcap during package() and applying
the resulting capabilities to the installed program. Formerly, it was
necessary to edit the binary after the fact (and thus dirty the file
according to -Qkk) by using an install scriptlet.

One problem that needs to be solved before this is useful, is preventing
the strip routine from destroying xattrs. This is taken care of in the
previous patch.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2021-02-07 19:55:17 -05:00 committed by Allan McRae
parent 88d054093c
commit 3a23abb2ec

View file

@ -119,6 +119,7 @@ static int perform_extraction(alpm_handle_t *handle, struct archive *archive,
ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_PERM |
ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_TIME |
ARCHIVE_EXTRACT_UNLINK | ARCHIVE_EXTRACT_UNLINK |
ARCHIVE_EXTRACT_XATTR |
ARCHIVE_EXTRACT_SECURE_SYMLINKS; ARCHIVE_EXTRACT_SECURE_SYMLINKS;
archive_entry_set_pathname(entry, filename); archive_entry_set_pathname(entry, filename);