summaryrefslogtreecommitdiff
path: root/include/libacl.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2001-08-06 02:41:49 +0000
committerNathan Scott <nathans@sgi.com>2001-08-06 02:41:49 +0000
commitf1479ac3d3bf18193bf24d6e1a09bd9726ac72d4 (patch)
tree7ff1efc242848c8a77b636e0e1c68404d9c2b3e3 /include/libacl.h
parentd83011a4a2e9ece813eb960e95ccd9dbf2def385 (diff)
downloadacl-f1479ac3d3bf18193bf24d6e1a09bd9726ac72d4.tar.gz
add in Andreas Gruenbacher's ACL userspace tools, unchanged.
Diffstat (limited to 'include/libacl.h')
-rw-r--r--include/libacl.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/include/libacl.h b/include/libacl.h
new file mode 100644
index 0000000..f281110
--- /dev/null
+++ b/include/libacl.h
@@ -0,0 +1,117 @@
+/*
+ File: libacl.h
+
+ (C) 1999, 2000 Andreas Gruenbacher, <a.gruenbacher@computer.org>
+*/
+
+#ifndef __ACL_LIBACL_H
+#define __ACL_LIBACL_H
+
+#include <sys/acl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* acl_entry_to_any_str(), acl_to_any_text() */
+
+/* Print NO, SOME or ALL effective permissions comments. SOME prints
+ effective rights comments for entries which have different permissions
+ than effective permissions. */
+#define TEXT_NO_EFFECTIVE 0x00
+#define TEXT_SOME_EFFECTIVE 0x01
+#define TEXT_ALL_EFFECTIVE 0x02
+
+/* Align effective permission comments to column 32 using tabs or
+ use a single tab. */
+#define TEXT_SMART_INDENT 0x04
+
+/* User and group IDs instead of names. */
+#define TEXT_NUMERIC_IDS 0x08
+
+/* Only output the first letter of entry types
+ ("u::rwx" instead of "user::rwx"). */
+#define TEXT_ABBREVIATE 0x10
+
+/* acl_check error codes */
+
+#define ACL_MULTI_ERROR (0x1000) /* multiple unique objects */
+#define ACL_DUPLICATE_ERROR (0x2000) /* duplicate Id's in entries */
+#define ACL_MISS_ERROR (0x3000) /* missing required entry */
+#define ACL_ENTRY_ERROR (0x4000) /* wrong entry type */
+
+extern char *
+acl_to_any_text(
+ acl_t acl,
+ ssize_t *len_p,
+ const char *prefix,
+ char separator,
+ const char *suffix,
+ int options);
+extern ssize_t
+acl_entry_to_any_str(
+ const acl_entry_t entry_d,
+ char *text_p,
+ ssize_t size,
+ const acl_entry_t mask_d,
+ const char *prefix,
+ int options);
+extern int
+acl_cmp(
+ acl_t acl1,
+ acl_t acl2);
+extern int
+acl_check(
+ acl_t acl,
+ int *last);
+extern acl_t
+acl_from_mode(
+ mode_t mode);
+extern int
+acl_equiv_mode(
+ acl_t acl,
+ mode_t *mode_p);
+extern acl_t
+acl_get_file_mode(
+ const char *path_p);
+extern acl_t
+acl_get_fd_mode(
+ int fd);
+extern int
+acl_set_file_mode(
+ const char *path_p,
+ acl_type_t type,
+ acl_t acl);
+extern int
+acl_set_fd_mode(
+ int fd,
+ acl_t acl);
+int
+acl_extended_file(
+ const char *path_p);
+int
+acl_extended_fd(
+ int fd);
+extern int
+acl_print(
+ FILE *file,
+ acl_t acl,
+ const char *prefix,
+ int options);
+extern int
+acl_entries(
+ acl_t acl);
+extern const char *
+acl_error(
+ int code);
+extern int
+acl_get_perm(
+ acl_permset_t permset_d,
+ acl_perm_t perm);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ACL_LIBACL_H */
+