svn commit: r240702 - in releng/9.1/usr.sbin/pkg_install: add lib

Jung-uk Kim jkim at FreeBSD.org
Wed Sep 19 19:14:22 UTC 2012


Author: jkim
Date: Wed Sep 19 19:14:21 2012
New Revision: 240702
URL: http://svn.freebsd.org/changeset/base/240702

Log:
  MFC:	r240476
  
  Do not change owner, group, or mode when package database directory
  and its contents are created with pkg_add(1).  It may happen when the
  packing list contains @owner, @group, or @mode.
  
  Approved by:	re (kib), portmgr (bapt)

Modified:
  releng/9.1/usr.sbin/pkg_install/add/add.h
  releng/9.1/usr.sbin/pkg_install/add/extract.c
  releng/9.1/usr.sbin/pkg_install/add/futil.c
  releng/9.1/usr.sbin/pkg_install/add/perform.c
  releng/9.1/usr.sbin/pkg_install/lib/lib.h
Directory Properties:
  releng/9.1/usr.sbin/pkg_install/   (props changed)
  releng/9.1/usr.sbin/pkg_install/add/   (props changed)

Modified: releng/9.1/usr.sbin/pkg_install/add/add.h
==============================================================================
--- releng/9.1/usr.sbin/pkg_install/add/add.h	Wed Sep 19 18:42:31 2012	(r240701)
+++ releng/9.1/usr.sbin/pkg_install/add/add.h	Wed Sep 19 19:14:21 2012	(r240702)
@@ -41,7 +41,7 @@ extern char	*PkgAddCmd;
 extern char	FirstPen[];
 extern add_mode_t AddMode;
 
-int		make_hierarchy(char *);
+int		make_hierarchy(char *, Boolean);
 void		extract_plist(const char *, Package *);
 void		apply_perms(const char *, const char *);
 

Modified: releng/9.1/usr.sbin/pkg_install/add/extract.c
==============================================================================
--- releng/9.1/usr.sbin/pkg_install/add/extract.c	Wed Sep 19 18:42:31 2012	(r240701)
+++ releng/9.1/usr.sbin/pkg_install/add/extract.c	Wed Sep 19 19:14:21 2012	(r240702)
@@ -225,7 +225,7 @@ extract_plist(const char *home, Package 
 		printf("extract: CWD to %s\n", p->name);
 	    PUSHOUT(Directory);
 	    if (strcmp(p->name, ".")) {
-		if (!Fake && make_hierarchy(p->name) == FAIL) {
+		if (!Fake && make_hierarchy(p->name, TRUE) == FAIL) {
 		    cleanup(0);
 		    errx(2, "%s: unable to cwd to '%s'", __func__, p->name);
 		}

Modified: releng/9.1/usr.sbin/pkg_install/add/futil.c
==============================================================================
--- releng/9.1/usr.sbin/pkg_install/add/futil.c	Wed Sep 19 18:42:31 2012	(r240701)
+++ releng/9.1/usr.sbin/pkg_install/add/futil.c	Wed Sep 19 19:14:21 2012	(r240702)
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
  */
 
 int
-make_hierarchy(char *dir)
+make_hierarchy(char *dir, Boolean set_perm)
 {
     char *cp1, *cp2;
 
@@ -55,7 +55,8 @@ make_hierarchy(char *dir)
 		    *cp2 = '/';
 		return FAIL;
 	    }
-	    apply_perms(NULL, dir);
+	    if (set_perm)
+		apply_perms(NULL, dir);
 	}
 	/* Put it back */
 	if (cp2) {

Modified: releng/9.1/usr.sbin/pkg_install/add/perform.c
==============================================================================
--- releng/9.1/usr.sbin/pkg_install/add/perform.c	Wed Sep 19 18:42:31 2012	(r240701)
+++ releng/9.1/usr.sbin/pkg_install/add/perform.c	Wed Sep 19 19:14:21 2012	(r240702)
@@ -511,7 +511,7 @@ pkg_do(char *pkg)
 	zapLogDir = 1;
 	if (Verbose)
 	    printf("Attempting to record package into %s..\n", LogDir);
-	if (make_hierarchy(LogDir)) {
+	if (make_hierarchy(LogDir, FALSE)) {
 	    warnx("can't record package into '%s', you're on your own!",
 		   LogDir);
 	    bzero(LogDir, FILENAME_MAX);

Modified: releng/9.1/usr.sbin/pkg_install/lib/lib.h
==============================================================================
--- releng/9.1/usr.sbin/pkg_install/lib/lib.h	Wed Sep 19 18:42:31 2012	(r240701)
+++ releng/9.1/usr.sbin/pkg_install/lib/lib.h	Wed Sep 19 19:14:21 2012	(r240702)
@@ -99,7 +99,7 @@
  * Version of the package tools - increase whenever you make a change
  * in the code that is not cosmetic only.
  */
-#define PKG_INSTALL_VERSION	20120530
+#define PKG_INSTALL_VERSION	20120913
 
 #define PKG_WRAPCONF_FNAME	"/var/db/pkg_install.conf"
 #define main(argc, argv)	real_main(argc, argv)


More information about the svn-src-all mailing list