diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-01-06 18:41:36 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-03-08 13:56:40 +0100 |
commit | 9ddf063921f5202100f8e36bb451ae5ac9f76d37 (patch) | |
tree | 11d9f59ac8db1b11c7f261f6ce8e4b47720bf1fa /winsup/cygwin/include/acl/libacl.h | |
parent | edd7d93484703b81b5e203a9c7c490f117eb4e42 (diff) | |
download | cygnal-9ddf063921f5202100f8e36bb451ae5ac9f76d37.tar.gz cygnal-9ddf063921f5202100f8e36bb451ae5ac9f76d37.tar.bz2 cygnal-9ddf063921f5202100f8e36bb451ae5ac9f76d37.zip |
Implement POSIX.1e ACL functions
* Makefile.in (DLL_OFILES): Add sec_posixacl.o.
(SUBLIBS): Add libacl.a
(libacl.a): New rule to create libacl.a.
* common.din: Export POSIX ACL functions as well as most libacl.a
extensions.
* fhandler.h (fhander_base::acl_get): New prototype.
(fhander_base::acl_set): Ditto.
(fhandler_disk_file::acl_get): Ditto.
(fhandler_disk_file::acl_set): Ditto.
* include/acl/libacl.h: New file.
* include/cygwin/version.h: Bump API minor version.
* include/sys/acl.h: Drop including cygwin/acl.h. Accommodate
throughout Cygwin. Add POSIX ACL definitions.
* sec_acl.cc: Include sec_posixacl.h. Replace ILLEGAL_UID and
ILLEGAL_GID with ACL_UNDEFINED_ID where sensible.
(__aclcheck): New internal acl check function to be used for
Solaris and POSIX ACLs.
(aclcheck32): Call __aclcheck.
(__aclcalcmask): New function to compute ACL_MASK value.
(__aclsort): New internal acl sort function to be used for Solaris
and POSIX ACLs.
(aclsort32): Call __aclsort.
(permtostr): Work directly on provided buffer.
(__acltotext): New internal acltotext function to be used for
Solaris and POSIX ACLs.
(acltotext32): Call __acltotext.
(__aclfromtext): New internal aclfromtext function to be used for
Solaris and POSIX ACLs.
(aclfromtext32): Call __aclfromtext.
* sec_posixacl.cc: New file implemeting POSIX ACL functions.
* sec_posixacl.h: New internal header.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/include/acl/libacl.h')
-rw-r--r-- | winsup/cygwin/include/acl/libacl.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/winsup/cygwin/include/acl/libacl.h b/winsup/cygwin/include/acl/libacl.h new file mode 100644 index 000000000..b93d686b1 --- /dev/null +++ b/winsup/cygwin/include/acl/libacl.h @@ -0,0 +1,55 @@ +/* acl/libacl.h: Non-POSIX extensions of libacl + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _ACL_LIBACL_H +#define _ACL_LIBACL_H + +#include <sys/acl.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Sync'd with cygwin/acl.h values. */ +#define ACL_MULTI_ERROR (0x4) +#define ACL_DUPLICATE_ERROR (0x5) +#define ACL_ENTRY_ERROR (0x6) +#define ACL_MISS_ERROR (0x7) + +/* acl_to_any_text options. */ +#define TEXT_ABBREVIATE (0x01) +#define TEXT_NUMERIC_IDS (0x02) +#define TEXT_SOME_EFFECTIVE (0x04) +#define TEXT_ALL_EFFECTIVE (0x08) +#define TEXT_SMART_INDENT (0x10) + +extern int acl_check (acl_t __acl, int *__last); +extern int acl_cmp (acl_t __acl1, acl_t __acl2); +extern int acl_entries (acl_t __acl); +extern int acl_equiv_mode (acl_t __acl, mode_t *__mode_p); +extern const char *acl_error (int __code); +extern int acl_extended_fd (int __fd); +extern int acl_extended_file (const char *__path_p); +extern int acl_extended_file_nofollow (const char *__path_p); +extern acl_t acl_from_mode (mode_t __mode); +extern int acl_get_perm (acl_permset_t __permset_d, acl_perm_t __perm); +extern char *acl_to_any_text (acl_t __acl, const char *__prefix, + char __separator, int __options); + +#if 0 +/* TODO */ +struct error_context; +extern int perm_copy_file (const char *, const char *, struct error_context *); +extern int perm_copy_fd (const char *, int, const char *, int, + struct error_context *); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _ACL_LIBACL_H */ |