pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/archivers/libarchive/files/libarchive Merge 1a1be097da...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/00b52edf3f78
branches:  trunk
changeset: 359486:00b52edf3f78
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Mar 12 06:52:23 2017 +0000

description:
Merge 1a1be097da6c042a83fff26bdce361101bb869c8:

  Darwin ACL: avoid unnecessary use of getpwuuid() and getgruuid()

diffstat:

 archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c |  24 +--------
 1 files changed, 4 insertions(+), 20 deletions(-)

diffs (50 lines):

diff -r 849735f3360e -r 00b52edf3f78 archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c
--- a/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c Sun Mar 12 06:51:23 2017 +0000
+++ b/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c Sun Mar 12 06:52:23 2017 +0000
@@ -40,8 +40,6 @@
 #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 @@
        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 @@
        }
        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;
 



Home | Main Index | Thread Index | Old Index