diff options
author | jedgar <jedgar@FreeBSD.org> | 2001-04-11 22:09:51 +0000 |
---|---|---|
committer | jedgar <jedgar@FreeBSD.org> | 2001-04-11 22:09:51 +0000 |
commit | 96b8f4bcfec7f0f9b417b8a78a441981da87e5d4 (patch) | |
tree | a3e97e2e1ada7e1df549d61dbefef15d3016cff8 /lib/libc/posix1e/acl_entry.c | |
parent | 94db785410adcb2086335923409402f63e4e4f9f (diff) | |
download | FreeBSD-src-96b8f4bcfec7f0f9b417b8a78a441981da87e5d4.zip FreeBSD-src-96b8f4bcfec7f0f9b417b8a78a441981da87e5d4.tar.gz |
Revamp acl_create_entry() so it actually works.
Obtained from: TrustedBSD Project
Diffstat (limited to 'lib/libc/posix1e/acl_entry.c')
-rw-r--r-- | lib/libc/posix1e/acl_entry.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/libc/posix1e/acl_entry.c b/lib/libc/posix1e/acl_entry.c index 47d66f6..49dfb84 100644 --- a/lib/libc/posix1e/acl_entry.c +++ b/lib/libc/posix1e/acl_entry.c @@ -41,7 +41,6 @@ int acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p) { acl_t acl; - struct acl_entry newentry; if (!acl_p || !*acl_p || ((*acl_p)->acl_cnt >= ACL_MAX_ENTRIES) || ((*acl_p)->acl_cnt < 0)) { @@ -49,30 +48,14 @@ acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p) return -1; } - entry_p = malloc(sizeof(acl_entry_t)); - if (!entry_p) - return -1; - *entry_p = malloc(sizeof(struct acl_entry)); - if (!*entry_p) - return -1; - acl = *acl_p; - **entry_p = acl->acl_entry[acl->acl_cnt]; + *entry_p = &acl->acl_entry[acl->acl_cnt++]; (**entry_p).ae_tag = ACL_UNDEFINED_TAG; (**entry_p).ae_id = ACL_UNDEFINED_ID; (**entry_p).ae_perm = ACL_PERM_NONE; - acl->acl_entry[acl->acl_cnt] = newentry; - acl->acl_cnt++; - - **entry_p = newentry; - - /* XXX - ok? */ - free(*entry_p); - free(entry_p); - return 0; } |