summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_support.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/posix1e/acl_support.c')
-rw-r--r--lib/libc/posix1e/acl_support.c63
1 files changed, 2 insertions, 61 deletions
diff --git a/lib/libc/posix1e/acl_support.c b/lib/libc/posix1e/acl_support.c
index 680debc..9f5404c 100644
--- a/lib/libc/posix1e/acl_support.c
+++ b/lib/libc/posix1e/acl_support.c
@@ -127,11 +127,9 @@ _posix1e_acl_entry_compare(struct acl_entry *a, struct acl_entry *b)
}
/*
- * _posix1e_acl_sort -- sort ACL entries in POSIX.1e-formatted ACLs
- * Give the opportunity to fail, although we don't currently have a way
- * to fail.
+ * _posix1e_acl_sort -- sort ACL entries in POSIX.1e-formatted ACLs.
*/
-int
+void
_posix1e_acl_sort(acl_t acl)
{
struct acl *acl_int;
@@ -140,8 +138,6 @@ _posix1e_acl_sort(acl_t acl)
qsort(&acl_int->acl_entry[0], acl_int->acl_cnt,
sizeof(struct acl_entry), (compare) _posix1e_acl_entry_compare);
-
- return (0);
}
/*
@@ -273,61 +269,6 @@ _posix1e_acl_check(acl_t acl)
return (0);
}
-
-/*
- * Given a uid/gid, return a username/groupname for the text form of an ACL.
- * Note that we truncate user and group names, rather than error out, as
- * this is consistent with other tools manipulating user and group names.
- * XXX NOT THREAD SAFE, RELIES ON GETPWUID, GETGRGID
- * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE
- * MAY HAVE SIDE-EFFECTS
- */
-int
-_posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, char *buf,
- int flags)
-{
- struct group *g;
- struct passwd *p;
- int i;
-
- switch(tag) {
- case ACL_USER:
- if (flags & ACL_TEXT_NUMERIC_IDS)
- p = NULL;
- else
- p = getpwuid(id);
- if (!p)
- i = snprintf(buf, buf_len, "%d", id);
- else
- i = snprintf(buf, buf_len, "%s", p->pw_name);
-
- if (i < 0) {
- errno = ENOMEM;
- return (-1);
- }
- return (0);
-
- case ACL_GROUP:
- if (flags & ACL_TEXT_NUMERIC_IDS)
- g = NULL;
- else
- g = getgrgid(id);
- if (g == NULL)
- i = snprintf(buf, buf_len, "%d", id);
- else
- i = snprintf(buf, buf_len, "%s", g->gr_name);
-
- if (i < 0) {
- errno = ENOMEM;
- return (-1);
- }
- return (0);
-
- default:
- return (EINVAL);
- }
-}
-
/*
* Given a right-shifted permission (i.e., direct ACL_PERM_* mask), fill
* in a string describing the permissions.
OpenPOWER on IntegriCloud