From: Maciej Liszewski <
m.lis...@welotec.com>
The libarchive library, which is being used by opkg supports ACLs
and xattr already.
Mor informations can be read at this link:
https://github.com/libarchive/libarchive/pull/691
Signed-off-by: Maciej Liszewski <
m.lis...@welotec.com>
Signed-off-by: Piotr Łobacz <
p.lo...@welotec.com>
---
configure.ac | 12 ++++++++++++
libopkg/opkg_archive.c | 8 ++++++++
2 files changed, 20 insertions(+)
diff --git a/
configure.ac b/
configure.ac
index 389a818..46949cd 100644
--- a/
configure.ac
+++ b/
configure.ac
@@ -158,6 +158,18 @@ return OPENSSL_VERSION_NUMBER; ],
AC_SUBST(OPENSSL_LIBS)
fi
+# check for ACL support
+AC_ARG_WITH([acl], [AS_HELP_STRING([--with-acl], [Enable ACL support])])
+if test "x$with_acl" = "xyes"; then
+ AC_DEFINE([ENABLE_ACL], [1], [Enable ACL support])
+fi
+
+# check for xattr support
+AC_ARG_WITH([xattr], [AS_HELP_STRING([--with-xattr], [Enable xattr support])])
+if test "x$with_xattr" = "xyes"; then
+ AC_DEFINE([ENABLE_XATTR], [1], [Enable xattr support])
+fi
+
# check for libsolv solver
AC_ARG_WITH(libsolv, AC_HELP_STRING([--with-libsolv], [Use libsolv solver support.
]), [], [with_libsolv="no"])
diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c
index 03a4afb..8dd902d 100644
--- a/libopkg/opkg_archive.c
+++ b/libopkg/opkg_archive.c
@@ -912,6 +912,14 @@ struct opkg_ar *ar_open_pkg_data_archive(const char *filename)
ar->extract_flags = ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM |
ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_UNLINK | ARCHIVE_EXTRACT_NO_OVERWRITE;
+#ifdef ENABLE_ACL
+ ar->extract_flags |= ARCHIVE_EXTRACT_ACL;
+#endif
+
+#ifdef ENABLE_XATTR
+ ar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR;
+#endif
+
if (opkg_config->ignore_uid)
ar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
--
2.34.1