diff options
author | jkim <jkim@FreeBSD.org> | 2012-09-14 00:19:06 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-09-14 00:19:06 +0000 |
commit | 544c9d83bdbd3f0ad156cc694316ff163baf8eb9 (patch) | |
tree | 690b5125951b51defc8143b1cfcae095bc2fe0e1 /usr.sbin/pkg_install | |
parent | d63ec4c4ce1de03b00bdd4813aeee11ee77907ea (diff) | |
download | FreeBSD-src-544c9d83bdbd3f0ad156cc694316ff163baf8eb9.zip FreeBSD-src-544c9d83bdbd3f0ad156cc694316ff163baf8eb9.tar.gz |
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.
Reported by: Donald Bostrom (dbostrom at niksun dot com)
Reviewed by: portmgr (bapt)
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/add/add.h | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/add/extract.c | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/add/futil.c | 5 | ||||
-rw-r--r-- | usr.sbin/pkg_install/add/perform.c | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/lib.h | 2 |
5 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/pkg_install/add/add.h b/usr.sbin/pkg_install/add/add.h index d9892ad..e796120 100644 --- a/usr.sbin/pkg_install/add/add.h +++ b/usr.sbin/pkg_install/add/add.h @@ -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 *); diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c index 90c33c0..9769464 100644 --- a/usr.sbin/pkg_install/add/extract.c +++ b/usr.sbin/pkg_install/add/extract.c @@ -225,7 +225,7 @@ extract_plist(const char *home, Package *pkg) 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); } diff --git a/usr.sbin/pkg_install/add/futil.c b/usr.sbin/pkg_install/add/futil.c index 8f9d369..82217f5 100644 --- a/usr.sbin/pkg_install/add/futil.c +++ b/usr.sbin/pkg_install/add/futil.c @@ -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) { diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index 24637eb..638e046 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -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); diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h index 7890254..e368b80 100644 --- a/usr.sbin/pkg_install/lib/lib.h +++ b/usr.sbin/pkg_install/lib/lib.h @@ -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) |