diff options
author | joerg <joerg@pkgsrc.org> | 2017-03-12 06:52:23 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2017-03-12 06:52:23 +0000 |
commit | 76a30c1086fa5b3eb94328ce98b070c20fecf763 (patch) | |
tree | c920e155bf237f3f5a4e645150acfe7220db30d7 /archivers | |
parent | 5eb09bb6b3c47e7920c9685a7f4488ba80ef43d0 (diff) | |
download | pkgsrc-76a30c1086fa5b3eb94328ce98b070c20fecf763.tar.gz |
Merge 1a1be097da6c042a83fff26bdce361101bb869c8:
Darwin ACL: avoid unnecessary use of getpwuuid() and getgruuid()
Diffstat (limited to 'archivers')
-rw-r--r-- | archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c b/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c index 9dec2e9080e..1c94afddba8 100644 --- a/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c +++ b/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010 #endif #ifdef HAVE_DARWIN_ACL #include <membership.h> -#include <grp.h> -#include <pwd.h> #endif #ifdef HAVE_SYS_EXTATTR_H #include <sys/extattr.h> @@ -856,8 +854,6 @@ static int translate_guid(struct archive *a, acl_entry_t acl_entry, void *q; uid_t ugid; int r, idtype; - struct passwd *pwd; - struct group *grp; q = acl_get_qualifier(acl_entry); if (q == NULL) @@ -869,24 +865,12 @@ static int translate_guid(struct archive *a, acl_entry_t acl_entry, } if (idtype == ID_TYPE_UID) { *ae_tag = ARCHIVE_ENTRY_ACL_USER; - pwd = getpwuuid(q); - if (pwd == NULL) { - *ae_id = ugid; - *ae_name = NULL; - } else { - *ae_id = pwd->pw_uid; - *ae_name = archive_read_disk_uname(a, *ae_id); - } + *ae_id = ugid; + *ae_name = archive_read_disk_uname(a, *ae_id); } else if (idtype == ID_TYPE_GID) { *ae_tag = ARCHIVE_ENTRY_ACL_GROUP; - grp = getgruuid(q); - if (grp == NULL) { - *ae_id = ugid; - *ae_name = NULL; - } else { - *ae_id = grp->gr_gid; - *ae_name = archive_read_disk_gname(a, *ae_id); - } + *ae_id = ugid; + *ae_name = archive_read_disk_gname(a, *ae_id); } else r = 1; |