pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkg_install/files



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Tue Apr 17 12:52:35 UTC 2018

Modified Files:
        pkgsrc/pkgtools/pkg_install/files/create: util.c
        pkgsrc/pkgtools/pkg_install/files/lib: version.h

Log Message:
pkg_install: Update to 20180417.

Fix an issue in pkg_create where we may have been using corrupted owner and
group information.  Noticed on macOS where libarchive would complain about
the owner entry being too long.  Reviewed by joerg.

Also includes some manual page improvements committed recently.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/pkg_install/files/create/util.c
cvs rdiff -u -r1.174 -r1.175 pkgsrc/pkgtools/pkg_install/files/lib/version.h

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

Modified files:

Index: pkgsrc/pkgtools/pkg_install/files/create/util.c
diff -u pkgsrc/pkgtools/pkg_install/files/create/util.c:1.6 pkgsrc/pkgtools/pkg_install/files/create/util.c:1.7
--- pkgsrc/pkgtools/pkg_install/files/create/util.c:1.6 Wed Apr 19 21:42:50 2017
+++ pkgsrc/pkgtools/pkg_install/files/create/util.c     Tue Apr 17 12:52:35 2018
@@ -65,7 +65,7 @@ update_ids(struct memory_file *file)
                        errx(2, "user %s unknown", file->owner);
                file->st.st_uid = uid;
        } else {
-               file->owner = user_from_uid(file->st.st_uid, 1);
+               file->owner = xstrdup(user_from_uid(file->st.st_uid, 1));
        }
 
        if (file->group != NULL) {
@@ -73,10 +73,9 @@ update_ids(struct memory_file *file)
 
                if (gid_from_group(file->group, &gid) == -1)
                        errx(2, "group %s unknown", file->group);
-               file->group = file->group;
                file->st.st_gid = gid;
        } else {
-               file->group = group_from_gid(file->st.st_gid, 1);
+               file->group = xstrdup(group_from_gid(file->st.st_gid, 1));
        }
 }
 
@@ -88,8 +87,8 @@ make_memory_file(const char *archive_nam
 
        file = xmalloc(sizeof(*file));
        file->name = archive_name;
-       file->owner = owner;
-       file->group = group;
+       file->owner = (owner != NULL) ? xstrdup(owner) : NULL;
+       file->group = (group != NULL) ? xstrdup(group) : NULL;
        file->data = data;
        file->len = len;
 
@@ -116,8 +115,8 @@ load_memory_file(const char *disk_name,
 
        file = xmalloc(sizeof(*file));
        file->name = archive_name;
-       file->owner = owner;
-       file->group = group;
+       file->owner = (owner != NULL) ? xstrdup(owner) : NULL;
+       file->group = (group != NULL) ? xstrdup(group) : NULL;
        file->mode = mode;
 
        fd = open(disk_name, O_RDONLY);
@@ -148,6 +147,8 @@ void
 free_memory_file(struct memory_file *file)
 {
        if (file != NULL) {
+               free((char *)file->owner);
+               free((char *)file->group);
                free(file->data);
                free(file);
        }

Index: pkgsrc/pkgtools/pkg_install/files/lib/version.h
diff -u pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.174 pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.175
--- pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.174       Sun Mar 25 03:56:28 2018
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h     Tue Apr 17 12:52:35 2018
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.174 2018/03/25 03:56:28 sevan Exp $      */
+/*     $NetBSD: version.h,v 1.175 2018/04/17 12:52:35 jperkin Exp $    */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20180325
+#define PKGTOOLS_VERSION 20180417
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index