summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_get.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-01-26 04:19:38 +0000
committerrwatson <rwatson@FreeBSD.org>2000-01-26 04:19:38 +0000
commitbca585a108d2bd5fc957868c934f851e28cc1fdc (patch)
tree9bf727d760779145abf4d333b026744f16082345 /lib/libc/posix1e/acl_get.c
parent994e477fcd5e774b309e83aa9a4b9dc634ce39e2 (diff)
downloadFreeBSD-src-bca585a108d2bd5fc957868c934f851e28cc1fdc.zip
FreeBSD-src-bca585a108d2bd5fc957868c934f851e28cc1fdc.tar.gz
Minor fixes to library interface to improve POSIX.1e compliance. This
adds _np to a couple of function prototypes that provided more broad/useful interfaces than POSIX.1e interfaces included. Also, move from using a heuristic to identify POSIX.1e-semantic ACLs to using different ACL types for non-POSIX.1e ACLs. This should clean up the existing fuzzy logic that determined when acl_sort() should be applied before kernel submission.
Diffstat (limited to 'lib/libc/posix1e/acl_get.c')
-rw-r--r--lib/libc/posix1e/acl_get.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/libc/posix1e/acl_get.c b/lib/libc/posix1e/acl_get.c
index 1293f0b..494eed7 100644
--- a/lib/libc/posix1e/acl_get.c
+++ b/lib/libc/posix1e/acl_get.c
@@ -27,6 +27,8 @@
*/
/*
* acl_get_file - syscall wrapper for retrieving ACL by filename
+ * acl_get_fd - syscall wrapper for retrieving access ACL by fd
+ * acl_get_fd_np - syscall wrapper for retrieving ACL by fd (non-POSIX)
*/
#include <sys/types.h>
@@ -54,9 +56,28 @@ acl_get_file(const char *path_p, acl_type_t type)
return (aclp);
}
+acl_t
+acl_get_fd(int fd)
+{
+ struct acl *aclp;
+ int error;
+
+ aclp = acl_init(ACL_MAX_ENTRIES);
+ if (!aclp) {
+ return (0);
+ }
+
+ error = __acl_get_fd(fd, ACL_TYPE_ACCESS, aclp);
+ if (error) {
+ acl_free(aclp);
+ return (0);
+ }
+
+ return (aclp);
+}
acl_t
-acl_get_fd(int fd, acl_type_t type)
+acl_get_fd_np(int fd, acl_type_t type)
{
struct acl *aclp;
int error;
OpenPOWER on IntegriCloud