summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_get.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-12-29 20:47:05 +0000
committerrwatson <rwatson@FreeBSD.org>2002-12-29 20:47:05 +0000
commitbce6bfbbec294637e0155592caaded654445629a (patch)
tree985bdae2196acf3128685ad7f46fecd574f00a3f /lib/libc/posix1e/acl_get.c
parent22c41db3e52c6f1d4dc6adf5207326b1259e119b (diff)
downloadFreeBSD-src-bce6bfbbec294637e0155592caaded654445629a.zip
FreeBSD-src-bce6bfbbec294637e0155592caaded654445629a.tar.gz
Update libc POSIX.1e code and documentation to reflect:
- Updated copyrights, modified dates - Remove "BUGS" entry indicating that ACLs are unimplemented - Implement acl_*_link() library wrapper variants for get, set, delete, aclvalid. - Document acl_*_link() calls. Obtained from: TrustedBSD Project
Diffstat (limited to 'lib/libc/posix1e/acl_get.c')
-rw-r--r--lib/libc/posix1e/acl_get.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/libc/posix1e/acl_get.c b/lib/libc/posix1e/acl_get.c
index 87a51dd..1f97baa 100644
--- a/lib/libc/posix1e/acl_get.c
+++ b/lib/libc/posix1e/acl_get.c
@@ -1,7 +1,9 @@
/*-
- * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson
+ * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
* All rights reserved.
*
+ * This software was developed by Robert Watson for the TrustedBSD Project.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -24,9 +26,11 @@
* SUCH DAMAGE.
*/
/*
- * 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)
+ * acl_get_file - syscall wrapper for retrieving ACL by filename
+ * acl_get_link_np - syscall wrapper for retrieving ACL by filename (NOFOLLOW)
+ * (non-POSIX)
* acl_get_perm_np() checks if a permission is in the specified
* permset (non-POSIX)
* acl_get_permset() returns the permission set in the ACL entry
@@ -66,6 +70,25 @@ acl_get_file(const char *path_p, acl_type_t type)
}
acl_t
+acl_get_link_np(const char *path_p, acl_type_t type)
+{
+ acl_t aclp;
+ int error;
+
+ aclp = acl_init(ACL_MAX_ENTRIES);
+ if (aclp == NULL)
+ return (NULL);
+
+ error = __acl_get_link(path_p, type, &aclp->ats_acl);
+ if (error) {
+ acl_free(aclp);
+ return (NULL);
+ }
+
+ return (aclp);
+}
+
+acl_t
acl_get_fd(int fd)
{
acl_t aclp;
OpenPOWER on IntegriCloud