From 0575c15993403532d96920ae443655a2deb5393e Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Tue, 26 Jun 2007 08:47:46 +0000
Subject: Change pwd to / for all init scripts, #181224.

---
 src/runscript.c | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src')

diff --git a/src/runscript.c b/src/runscript.c
index 50a1931e..18ee1ddd 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -977,6 +977,9 @@ int main (int argc, char **argv)
 	service = argv[1];
 	applet = rc_xstrdup (basename (service));
 	atexit (cleanup);
+
+	/* Change dir to / to ensure all init scripts don't use stuff in pwd */
+	chdir ("/");
 	
 	/* Show help if insufficient args */
 	if (argc < 3) {
-- 
cgit v1.2.3