From 139f42ea23511d81a44e8925a24f7f218318010c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 26 Jul 2016 17:10:05 -0700 Subject: [PATCH] libattr is no longer needed wimlib only uses the extended attributes interface on Linux, where it appears it is now safe to assume the functions are present in libc (see: http://lists.nongnu.org/archive/html/acl-devel/2012-04/msg00001.html). Note: the setfattr program from the "attr" package is still required to run the NTFS-3G test script. --- README | 8 +------- archlinux/PKGBUILD | 3 ++- configure.ac | 8 +------- debian/control | 2 +- rpm/wimtools.spec | 2 +- src/mount_image.c | 9 ++++++--- tests/tree-cmp.c | 17 +++++++++++------ 7 files changed, 23 insertions(+), 26 deletions(-) diff --git a/README b/README index 3dc2aede..cc036571 100644 --- a/README +++ b/README @@ -146,12 +146,6 @@ dependencies were already included and this section is irrelevant. automatically be loaded if you try to mount a WIM image. For more information see http://fuse.sourceforge.net/. -* libattr (optional but recommended) - Unless configured --without-fuse, wimlib also requires libattr. Almost - all Linux distributions should include this; however, you may need to - install the header files, which might be in a package named "attr-dev", - "libattr1-dev", or similar. - * libntfs-3g (optional but recommended) Unless configured --without-ntfs-3g, wimlib requires the library and headers for libntfs-3g to be installed. The minimum required version is @@ -190,7 +184,7 @@ This section documents the most important options that may be passed to the --without-fuse The --without-fuse option disables support for mounting WIM images. - This removes dependencies on libfuse, librt, and libattr. The wimmount, + This removes dependencies on libfuse and librt. The wimmount, wimmountrw, and wimunmount commands will not work. The default is --with-fuse when building for Linux, and --without-fuse diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index 5a0d1bd4..11d86087 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -7,7 +7,8 @@ pkgdesc="A library and program to extract, create, and modify WIM files" arch=("i686" "x86_64") url="https://wimlib.net" license=("custom") -depends=("openssl" "fuse" "libxml2" "ntfs-3g" "attr") +depends=("openssl" "fuse" "libxml2" "ntfs-3g") +checkdepends=("attr") optdepends=("cdrkit: for making ISO image of Windows PE" "mtools: for making disk image of Windows PE" "syslinux: for making disk image of Windows PE" diff --git a/configure.ac b/configure.ac index dc569f7b..74ff4744 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,6 @@ AC_CHECK_FUNCS([futimens utimensat flock mempcpy \ # Header checks, most of which are only here to satisfy conditional includes # made by the libntfs-3g headers. AC_CHECK_HEADERS([alloca.h \ - attr/xattr.h \ byteswap.h \ endian.h \ errno.h \ @@ -78,6 +77,7 @@ AC_CHECK_HEADERS([alloca.h \ sys/file.h \ sys/sysctl.h \ sys/times.h \ + sys/xattr.h \ time.h \ utime.h]) @@ -159,12 +159,6 @@ if test "$WITH_FUSE" = "yes"; then versions of glibc include this library. Either install this library, or configure --without-fuse to disable support for mounting WIM images.])]) - AC_CHECK_LIB([attr], [getxattr], [], - [AC_MSG_ERROR([Cannot find libattr! - wimlib needs this for the extended attribute functions, which are used - in the code for mounting WIM images. Either install this library, or - configure --without-fuse to disable support for mounting WIM images.])]) - PKGCONFIG_PRIVATE_LIBS="$PKGCONFIG_PRIVATE_LIBS -lrt" AC_SUBST([LIBRT_LIBS], [-lrt]) fi diff --git a/debian/control b/debian/control index f424296a..e8c627e4 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Priority: optional Maintainer: Eric Biggers Build-Depends: debhelper (>= 8.9.7), autotools-dev, pkg-config, libfuse-dev, libxml2-dev, libssl-dev, - ntfs-3g-dev (>= 2011.4.12), attr-dev, attr + ntfs-3g-dev (>= 2011.4.12), attr Build-Depends-Indep: doxygen Standards-Version: 3.9.3 Section: libs diff --git a/rpm/wimtools.spec b/rpm/wimtools.spec index c2d7af7f..fe437c20 100644 --- a/rpm/wimtools.spec +++ b/rpm/wimtools.spec @@ -39,7 +39,7 @@ Development files for wimlib Summary: Library to extract, create, modify, and mount WIM files Group: System Environment/Libraries Requires: fuse -BuildRequires: libxml2-devel, fuse, fuse-devel, openssl-devel, libattr-devel +BuildRequires: libxml2-devel, fuse, fuse-devel, openssl-devel, attr BuildRequires: ntfs-3g-devel, ntfsprogs, libtool, pkgconfig %description -n libwim15 wimlib is a C library for extracting, creating, modifying, and mounting WIM diff --git a/src/mount_image.c b/src/mount_image.c index 6f0c6e1c..3641b204 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -39,9 +39,8 @@ #define FUSE_USE_VERSION 26 -#include /* sometimes required before */ - -#include +#include /* sometimes required before */ +#include #include #include #include @@ -71,6 +70,10 @@ # define O_NOFOLLOW 0 /* Security only... */ #endif +#ifndef ENOATTR +# define ENOATTR ENODATA +#endif + #define WIMFS_MQUEUE_NAME_LEN 32 #define WIMLIB_UNMOUNT_FLAG_SEND_PROGRESS 0x80000000 diff --git a/tests/tree-cmp.c b/tests/tree-cmp.c index b6051ccb..1fed0234 100644 --- a/tests/tree-cmp.c +++ b/tests/tree-cmp.c @@ -27,11 +27,16 @@ #include #include #include -#ifdef HAVE_ATTR_XATTR_H -#include +#include +#ifdef HAVE_SYS_XATTR_H +# include #endif #include +#ifndef ENOATTR +# define ENOATTR ENODATA +#endif + typedef uint64_t u64; #if 0 @@ -165,7 +170,7 @@ static void cmp(const char *file1, const char *file2, size_t size) close(fd2); } -#ifdef HAVE_ATTR_XATTR_H +#ifdef HAVE_SYS_XATTR_H /* Compares an extended attribute of the files. */ static void cmp_xattr(const char *file1, const char *file2, const char *xattr_name, ssize_t max_size, @@ -270,13 +275,13 @@ static void cmp_ads(const char *file1, const char *file2) free(list2); } } -#endif +#endif /* HAVE_SYS_XATTR_H */ /* Compares special NTFS data of the files, as accessed through extended * attributes. */ static void special_cmp(const char *file1, const char *file2) { -#ifdef HAVE_ATTR_XATTR_H +#ifdef HAVE_SYS_XATTR_H cmp_xattr(file1, file2, "system.ntfs_acl", 0, false); cmp_xattr(file1, file2, "system.ntfs_attrib", 0, false); cmp_xattr(file1, file2, "system.ntfs_dos_name", 0, true); @@ -287,7 +292,7 @@ static void special_cmp(const char *file1, const char *file2) #else fprintf(stderr, "tree-cmp: Warning: cannot compare xattrs of `%s' and `%s'\n", file1, file2); - fprintf(stderr, " You need to install the attr development files for this.\n"); + fprintf(stderr, " Extended attributes are not supported on this platform.\n"); #endif } -- 2.43.0