Package: libarchive1
Version: 2.8.4-1
Severity: normal
In libarchive/archive_read_disk_entry_from_file.c, there is code
to retrieve ext2 extended file attributes (see chattr(8)) from
regular files and directories but it is not enabled because of
some missing #includes.
Enabling it should only be a matter of applying the patch below
(though you'd probably wants to also add test code) which seems
to work as expected.
--- libarchive/archive_read_disk_entry_from_file.c~ 2011-02-28
16:55:27.000000000 +0000
+++ libarchive/archive_read_disk_entry_from_file.c 2011-02-28
16:55:52.501888288 +0000
@@ -26,6 +26,7 @@
#include "archive_platform.h"
__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c
201084 2009-12-28 02:14:09Z kientzle $");
+#include <fcntl.h>
#ifdef HAVE_SYS_TYPES_H
/* Mac OSX requires sys/types.h before sys/acl.h. */
#include <sys/types.h>
@@ -33,6 +34,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
#ifdef HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
@@ -45,6 +49,16 @@ __FBSDID("$FreeBSD: head/lib/libarchive/
#ifdef HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
+#ifdef HAVE_LINUX_EXT2_FS_H
+#include <linux/ext2_fs.h> /* for Linux file flags */
+#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h> /* Linux file flags, broken on Cygwin */
+#endif
#ifdef HAVE_ACL_LIBACL_H
#include <acl/libacl.h>
#endif
@@ -76,6 +90,10 @@ __FBSDID("$FreeBSD: head/lib/libarchive/
#define ACL_GET_PERM acl_get_perm_np
#endif
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
static int setup_acls_posix1e(struct archive_read_disk *,
struct archive_entry *, int fd);
static int setup_xattrs(struct archive_read_disk *,
@@ -103,7 +121,7 @@ archive_read_disk_entry_from_file(struct
* open file descriptor which we can use in the subsequent lookups. */
if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
if (fd < 0)
- fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY);
+ fd = open(path, O_RDONLY | O_NONBLOCK | O_BINARY);
if (fd >= 0) {
unsigned long stflags;
int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.37-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libarchive1 depends on:
ii libattr1 1:2.4.44-2 Extended attribute shared library
ii libc6 2.11.2-11 Embedded GNU C Library: Shared lib
ii libxml2 2.7.8.dfsg-2 GNOME XML library
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
libarchive1 recommends no packages.
libarchive1 suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]