[Reproducible-commits] [dpkg] 38/74: dpkg: On --force-chrootless only set changedir to instdir if defined

Mattia Rizzolo mattia at debian.org
Sun Jul 3 22:22:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.

commit b28741590210bf6eca9c10309433a54f332e661c
Author: Niall Walsh <niallwalsh at celtux.org>
Date:   Sat May 14 18:22:35 2016 +0200

    dpkg: On --force-chrootless only set changedir to instdir if defined
    
    This breaks --force-chrootless (or --force-all, which is a terrible
    idea in general) without having set --instdir.
    
    Closes: #824542
    Signed-off-by: Guillem Jover <guillem at debian.org>
---
 debian/changelog | 2 ++
 src/script.c     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index efde397..cbf3c0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
   * Set return buffer length for sysctl(2) calls on */kFreeBSD in
     start-stop-daemon.
   * Abstract ar archive handling behind a new struct dpkg_ar and functions.
+  * On dpkg --force-chrootless only set changedir to instdir if defined.
+    Thanks to Niall Walsh <niallwalsh at celtux.org>. Closes: #824542
   * Perl modules:
     - Use warnings::warnif() instead of carp() for deprecated warnings.
     - Add new format_range() method and deprecate dpkg() and rfc822() methods
diff --git a/src/script.c b/src/script.c
index 3c88be8..12e5555 100644
--- a/src/script.c
+++ b/src/script.c
@@ -98,7 +98,7 @@ static const char *
 maintscript_pre_exec(struct command *cmd)
 {
 	const char *admindir = dpkg_db_get_dir();
-	const char *changedir = fc_script_chrootless ? instdir : "/";
+	const char *changedir = (*instdir && fc_script_chrootless) ? instdir : "/";
 	size_t instdirl = strlen(instdir);
 
 	if (*instdir && !fc_script_chrootless) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list