summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_init.c
diff options
context:
space:
mode:
authorjedgar <jedgar@FreeBSD.org>2001-04-24 22:45:41 +0000
committerjedgar <jedgar@FreeBSD.org>2001-04-24 22:45:41 +0000
commit2da23531d99e45f34811fd6982a681112de0e182 (patch)
tree0b8830fcccafadf6607f3658e96733124ef8617d /lib/libc/posix1e/acl_init.c
parentecbf3eacd9a17a3a9b238e2fa65b2d33d85e8d1f (diff)
downloadFreeBSD-src-2da23531d99e45f34811fd6982a681112de0e182.zip
FreeBSD-src-2da23531d99e45f34811fd6982a681112de0e182.tar.gz
o Separate acl_t into internal and external representations as
required by POSIX.1e. This maintains the current 'struct acl' in the kernel while providing the generic external acl_t interface required to complete the ACL editing library. o Add the acl_get_entry() function. o Convert the existing ACL utilities, getfacl and setfacl, to fully make use of the ACL editing library. Obtained from: TrustedBSD Project
Diffstat (limited to 'lib/libc/posix1e/acl_init.c')
-rw-r--r--lib/libc/posix1e/acl_init.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/libc/posix1e/acl_init.c b/lib/libc/posix1e/acl_init.c
index d6e8f05..da36156 100644
--- a/lib/libc/posix1e/acl_init.c
+++ b/lib/libc/posix1e/acl_init.c
@@ -41,16 +41,20 @@
acl_t
acl_init(int count)
{
- struct acl *acl;
+ acl_t acl;
if (count > ACL_MAX_ENTRIES) {
errno = ENOMEM;
return (NULL);
}
+ if (count < 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
- acl = (struct acl *) malloc(sizeof(struct acl));
+ acl = malloc(sizeof(struct acl_t_struct));
if (acl != NULL)
- bzero(acl, sizeof(struct acl));
+ bzero(acl, sizeof(struct acl_t_struct));
return (acl);
}
@@ -58,13 +62,14 @@ acl_init(int count)
acl_t
acl_dup(acl_t acl)
{
- struct acl *acl_new;
+ acl_t acl_new;
acl_new = acl_init(ACL_MAX_ENTRIES);
if (!acl_new)
- return(NULL);
-
+ return NULL;
*acl_new = *acl;
+ acl->ats_cur_entry = 0;
+ acl_new->ats_cur_entry = 0;
return(acl_new);
}
OpenPOWER on IntegriCloud