Преглед изворни кода

dpkg: Fix --root by properly stripping root from maintainer script path

The cmd->filename variable was getting the full path to the maintainer
script inside the chroot, and once dpkg had changed root, the path was
not valid anymore.

Regression introduced in 5050748f1a6bb0c0728f8c07f9058d545c80d7e0.

Closes: #580984
Guillem Jover пре 16 година
родитељ
комит
67dc78b406
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 2 0
      debian/changelog
  2. 1 1
      src/help.c

+ 2 - 0
debian/changelog

@@ -26,6 +26,8 @@ dpkg (1.15.7.2) UNRELEASED; urgency=low
   * Add powerpcspe support to ostable and triplettable.
   * Add powerpcspe support to ostable and triplettable.
     Thanks to Sebastian Andrzej Siewior <sebastian@breakpoint.cc> and
     Thanks to Sebastian Andrzej Siewior <sebastian@breakpoint.cc> and
     Kyle Moffett <Kyle.D.Moffett@boeing.com>. Closes: #568123, #575158
     Kyle Moffett <Kyle.D.Moffett@boeing.com>. Closes: #568123, #575158
+  * Fix dpkg --root by properly stripping again the root directory from the
+    path of the maintainer script to execute. Closes: #580984
 
 
  -- Raphaël Hertzog <hertzog@debian.org>  Fri, 23 Apr 2010 18:17:14 +0200
  -- Raphaël Hertzog <hertzog@debian.org>  Fri, 23 Apr 2010 18:17:14 +0200
 
 

+ 1 - 1
src/help.c

@@ -265,7 +265,7 @@ do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
         setenv(MAINTSCRIPTDPKGENVVAR, PACKAGE_VERSION, 1))
         setenv(MAINTSCRIPTDPKGENVVAR, PACKAGE_VERSION, 1))
       ohshite(_("unable to setenv for maintainer script"));
       ohshite(_("unable to setenv for maintainer script"));
 
 
-    cmd->argv[0] = preexecscript(cmd);
+    cmd->filename = cmd->argv[0] = preexecscript(cmd);
     command_exec(cmd);
     command_exec(cmd);
   }
   }
   subproc_signals_setup(cmd->name); /* This does a push_cleanup() */
   subproc_signals_setup(cmd->name); /* This does a push_cleanup() */