diff options
author | jedgar <jedgar@FreeBSD.org> | 2001-04-24 22:45:41 +0000 |
---|---|---|
committer | jedgar <jedgar@FreeBSD.org> | 2001-04-24 22:45:41 +0000 |
commit | 2da23531d99e45f34811fd6982a681112de0e182 (patch) | |
tree | 0b8830fcccafadf6607f3658e96733124ef8617d /lib/libc/posix1e/acl_to_text.c | |
parent | ecbf3eacd9a17a3a9b238e2fa65b2d33d85e8d1f (diff) | |
download | FreeBSD-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_to_text.c')
-rw-r--r-- | lib/libc/posix1e/acl_to_text.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/libc/posix1e/acl_to_text.c b/lib/libc/posix1e/acl_to_text.c index 20f2b9e..4c079e4 100644 --- a/lib/libc/posix1e/acl_to_text.c +++ b/lib/libc/posix1e/acl_to_text.c @@ -52,28 +52,31 @@ char * acl_to_text(acl_t acl, ssize_t *len_p) { - char *buf, *tmpbuf; - char name_buf[UT_NAMESIZE+1]; - char perm_buf[_POSIX1E_ACL_STRING_PERM_MAXSIZE+1], - effective_perm_buf[_POSIX1E_ACL_STRING_PERM_MAXSIZE+1]; - int i, error, len; - uid_t ae_id; - acl_tag_t ae_tag; - acl_perm_t ae_perm, effective_perm, mask_perm; + struct acl *acl_int; + char *buf, *tmpbuf; + char name_buf[UT_NAMESIZE+1]; + char perm_buf[_POSIX1E_ACL_STRING_PERM_MAXSIZE+1], + effective_perm_buf[_POSIX1E_ACL_STRING_PERM_MAXSIZE+1]; + int i, error, len; + uid_t ae_id; + acl_tag_t ae_tag; + acl_perm_t ae_perm, effective_perm, mask_perm; buf = strdup(""); if (!buf) return(NULL); + acl_int = &acl->ats_acl; + mask_perm = ACL_PERM_BITS; /* effective is regular if no mask */ - for (i = 0; i < acl->acl_cnt; i++) - if (acl->acl_entry[i].ae_tag == ACL_MASK) - mask_perm = acl->acl_entry[i].ae_perm; - - for (i = 0; i < acl->acl_cnt; i++) { - ae_tag = acl->acl_entry[i].ae_tag; - ae_id = acl->acl_entry[i].ae_id; - ae_perm = acl->acl_entry[i].ae_perm; + for (i = 0; i < acl_int->acl_cnt; i++) + if (acl_int->acl_entry[i].ae_tag == ACL_MASK) + mask_perm = acl_int->acl_entry[i].ae_perm; + + for (i = 0; i < acl_int->acl_cnt; i++) { + ae_tag = acl_int->acl_entry[i].ae_tag; + ae_id = acl_int->acl_entry[i].ae_id; + ae_perm = acl_int->acl_entry[i].ae_perm; switch(ae_tag) { case ACL_USER_OBJ: |