瀏覽代碼

s-s-d: Fix --exec to work with relative arguments and --chdir

Closes: #669047
Guillem Jover 14 年之前
父節點
當前提交
fd35aec4fa
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 2 0
      debian/changelog
  2. 3 0
      utils/start-stop-daemon.c

+ 2 - 0
debian/changelog

@@ -29,6 +29,8 @@ dpkg (1.16.3) UNRELEASED; urgency=low
     the behaviour with the deb format.
   * Add support for an abitable containing arch attribute overrides.
   * Add x32 support to abitable, ostable and triplettable. Closes: #667037
+  * Fix start-stop-daemon to work with relative --exec arguments and --chdir.
+    Closes: #669047
 
   [ Helge Kreutzmann ]
   * Fix a typo in man/dpkg-buildflags.1.

+ 3 - 0
utils/start-stop-daemon.c

@@ -1618,6 +1618,9 @@ main(int argc, char **argv)
 	if (execname) {
 		char *fullexecname;
 
+		/* If it's a relative path, normalize it. */
+		if (execname[0] != '/')
+			execname = newpath(changedir, execname);
 
 		if (changeroot)
 			fullexecname = newpath(changeroot, execname);