pkgsrc-Changes archive

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

CVS commit: pkgsrc/archivers/libarchive/files/libarchive



Module Name:    pkgsrc
Committed By:   joerg
Date:           Sun Mar 12 06:52:23 UTC 2017

Modified Files:
        pkgsrc/archivers/libarchive/files/libarchive:
            archive_read_disk_entry_from_file.c

Log Message:
Merge 1a1be097da6c042a83fff26bdce361101bb869c8:

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
    pkgsrc/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c
diff -u pkgsrc/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c:1.8 pkgsrc/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c:1.9
--- pkgsrc/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c:1.8        Sun Mar 12 06:48:36 2017
+++ pkgsrc/archivers/libarchive/files/libarchive/archive_read_disk_entry_from_file.c    Sun Mar 12 06:52:23 2017
@@ -40,8 +40,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/
 #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
        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
        }
        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