btrfs-progs: convert: drop dependency on sys/acl.h
authorDavid Sterba <dsterba@suse.cz>
Mon, 4 May 2015 16:36:21 +0000 (18:36 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 14 May 2015 13:41:06 +0000 (15:41 +0200)
The file sys/acl.h is part of libacl and if the development package is
not installed, build of btrfs-convert fails.

We do not link against libacl nor use the functions provided by libacl.  The
ACL_* values are directly read from the extN data, so it's more part of the
on-disk format rather than an interface to libacl.

The dependency on libacl is completely dropped.

Reported-by: Hugo Mills <hugo@carfax.org.uk>
Signed-off-by: David Sterba <dsterba@suse.cz>
INSTALL
btrfs-convert.c

diff --git a/INSTALL b/INSTALL
index cc48217..f8d719a 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -17,10 +17,9 @@ Generating documentation:
 - asciidoc - text document format tool
 - xmlto - text document format tool
 
-XATTR and ACL libraries should be provided by the standard C library or by
+XATTR library should be provided by the standard C library or by
 
 - libattr - extended attribute library
-- libacl - access control list library
 
 Please note that the package names may differ according to the distribution.
 See https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories#Dependencies .
index f9dd734..9a9d619 100644 (file)
@@ -24,7 +24,6 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/acl.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <uuid/uuid.h>
@@ -692,6 +691,20 @@ static int ext2_xattr_check_entry(struct ext2_ext_attr_entry *entry,
 
 #define EXT2_ACL_VERSION       0x0001
 
+/* 23.2.5 acl_tag_t values */
+
+#define ACL_UNDEFINED_TAG       (0x00)
+#define ACL_USER_OBJ            (0x01)
+#define ACL_USER                (0x02)
+#define ACL_GROUP_OBJ           (0x04)
+#define ACL_GROUP               (0x08)
+#define ACL_MASK                (0x10)
+#define ACL_OTHER               (0x20)
+
+/* 23.2.7 ACL qualifier constants */
+
+#define ACL_UNDEFINED_ID        ((id_t)-1)
+
 typedef struct {
        __le16          e_tag;
        __le16          e_perm;