Browse Source

Set the HOME environment variable when using the --chuid switch in
start-stop-daemon. Closes: #295169, #267784

Guillem Jover 20 years ago
parent
commit
e54c24f03a
3 changed files with 10 additions and 1 deletions
  1. 5 0
      ChangeLog
  2. 3 1
      debian/changelog
  3. 2 0
      utils/start-stop-daemon.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2006-02-06  Guillem Jover  <guillem@debian.org>
+
+	* utils/start-stop-daemon.c (main): When using --chuid set the HOME
+	environment variable.
+
 2006-02-05  Christian Perrier  <bubulle@debian.org>
 
 	* man/*. Switch all translations to po4a. Work contributed

+ 3 - 1
debian/changelog

@@ -2,7 +2,9 @@ dpkg (1.13.14~) UNRELEASED; urgency=low
 
   [ Guillem Jover ]
   * Make start-stop-daemon print the proper version instead of 'VERSION'.
-  
+  * Set the HOME environment variable when using the --chuid switch in
+    start-stop-daemon. Closes: #295169, #267784
+
   [ Frank Lichtenheld ]
   * Let dpkg-source ignore comments in the hunk header as used by
     diff -p (Anand Kumria). Closes: #344880

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

@@ -1227,6 +1227,8 @@ main(int argc, char **argv)
 			changegroup = ""; /* just empty */
 			runas_gid = pw->pw_gid;
 		}
+		if (access(pw->pw_dir, F_OK) == 0)
+			setenv("HOME", pw->pw_dir, 1);
 	}
 
 	if (stop) {