summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-06-05 21:48:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:53 -0500
commitca62ddd8d901cce923d1cda958793054f80b1f57 (patch)
treec32836c83e6d7102ae4bde6917a5251f7d493860 /source4/utils
parent2a9982aa52d07605a5170806530ee46eae38a78e (diff)
downloadsamba-ca62ddd8d901cce923d1cda958793054f80b1f57.tar.gz
samba-ca62ddd8d901cce923d1cda958793054f80b1f57.tar.bz2
samba-ca62ddd8d901cce923d1cda958793054f80b1f57.zip
r16051: Move the XATTR compatability code into a new file, so I can use it for
the getntacl utility. Andrew Bartlett (This used to be commit b1e0d4747b412929e1d4e24d6d9e504df3ddc824)
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/config.mk2
-rw-r--r--source4/utils/getntacl.c18
2 files changed, 4 insertions, 16 deletions
diff --git a/source4/utils/config.mk b/source4/utils/config.mk
index cc89f5cc4f..2dbf26940e 100644
--- a/source4/utils/config.mk
+++ b/source4/utils/config.mk
@@ -47,7 +47,7 @@ PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
NDR_XATTR \
- XATTR
+ WRAP_XATTR
# End BINARY getntacl
#################################
diff --git a/source4/utils/getntacl.c b/source4/utils/getntacl.c
index 98aec2804e..441f233a84 100644
--- a/source4/utils/getntacl.c
+++ b/source4/utils/getntacl.c
@@ -23,8 +23,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "librpc/gen_ndr/ndr_xattr.h"
-
-#if HAVE_XATTR_SUPPORT
+#include "lib/util/wrap_xattr.h"
static void ntacl_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
@@ -57,7 +56,7 @@ static NTSTATUS get_ntacl(char *filename, struct xattr_NTACL **ntacl,
*ntacl = talloc(NULL, struct xattr_NTACL);
- size = getxattr(filename, XATTR_NTACL_NAME, NULL, 0);
+ size = wrap_getxattr(filename, XATTR_NTACL_NAME, NULL, 0);
if (size < 0) {
fprintf(stderr, "get_ntacl: %s\n", strerror(errno));
@@ -65,7 +64,7 @@ static NTSTATUS get_ntacl(char *filename, struct xattr_NTACL **ntacl,
}
blob.data = talloc_size(*ntacl, size);
- size = getxattr(filename, XATTR_NTACL_NAME, blob.data, size);
+ size = wrap_getxattr(filename, XATTR_NTACL_NAME, blob.data, size);
if (size < 0) {
fprintf(stderr, "get_ntacl: %s\n", strerror(errno));
return NT_STATUS_INTERNAL_ERROR;
@@ -109,14 +108,3 @@ int main(int argc, char *argv[])
return 0;
}
-
-#else
-
-int main(int argc, char *argv[])
-{
- printf("getntacl: not compiled with xattr support!\n");
- return 1;
-
-}
-
-#endif