summaryrefslogtreecommitdiff
path: root/lib/acl-internal.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-06-13 02:11:03 +0200
committerBruno Haible <bruno@clisp.org>2011-06-13 02:11:03 +0200
commit227b08bbf68b66e8d7cd4da5c1a6f0ebf5a5d9e8 (patch)
tree91f3e525a17a538c8e00c635064554f0c2f6469b /lib/acl-internal.h
parent9cbf59b7fd224f263fce77ef1dadd3be5439fc4f (diff)
downloadgnulib-227b08bbf68b66e8d7cd4da5c1a6f0ebf5a5d9e8.tar.gz
acl: Add support for HP-UX >= 11.11 JFS ACLs.
* doc/acl-resources.txt: Add info about the ACL APIs on HP-UX. * m4/acl.m4 (gl_FUNC_ACL): Also test for HP-UX 11.11 API. * lib/acl-internal.h [HP-UX 11.11]: Include <aclv.h>. (acl, aclsort): New declarations. (aclv_nontrivial): New declaration. * lib/file-has-acl.c (aclv_nontrivial) [HP-UX 11.11]: New function. (file_has_acl): Read also the second kind of HP-UX ACLs. * lib/set-mode-acl.c (qset_acl) [HP-UX 11.11]: Try to set the second kind of HP-UX ACLs if the first kind fails. * lib/copy-acl.c (qcopy_acl) [HP-UX 11.11]: Read and set also the second kind of HP-UX ACLs. * tests/test-sameacls.c [HP-UX 11.11]: Include <aclv.h>. (main) [HP-UX 11.11]: Test also whether the second kind of HP-UX ACLs agree. * tests/test-file-has-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. Handle hpuxjfs. * tests/test-set-mode-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. Handle hpuxjfs. * tests/test-copy-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. (func_test_same_acls): Use both lsacl and getacl. Handle hpuxjfs. * tests/test-copy-file.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. (func_test_same_acls): Use both lsacl and getacl. Handle hpuxjfs.
Diffstat (limited to 'lib/acl-internal.h')
-rw-r--r--lib/acl-internal.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 0eb11bc30e..b3160a71c4 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -35,6 +35,15 @@
# include <acl/libacl.h>
#endif
+/* On HP-UX >= 11.11, additional ACL API is available in <aclv.h>. */
+#if HAVE_ACLV_H
+# include <sys/types.h>
+# include <aclv.h>
+/* HP-UX 11.11 lacks these declarations. */
+extern int acl (char *, int, int, struct acl *);
+extern int aclsort (int, int, struct acl *);
+#endif
+
#include "error.h"
#include "quote.h"
@@ -206,6 +215,14 @@ extern int acl_ace_nontrivial (int count, ace_t *entries);
Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */
extern int acl_nontrivial (int count, struct acl_entry *entries, struct stat *sb);
+# if HAVE_ACLV_H /* HP-UX >= 11.11 */
+
+/* Return 1 if the given ACL is non-trivial.
+ Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */
+extern int aclv_nontrivial (int count, struct acl *entries);
+
+# endif
+
# elif HAVE_ACLX_GET && 0 /* AIX */
/* TODO */