diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/runscript.c | 3 |
2 files changed, 4 insertions, 0 deletions
@@ -4,6 +4,7 @@ 26 Jun 2007; Roy Marples <uberlord@gentoo.org>: --nocolor works again, #181011 thanks to Daniel Drake. + Change pwd to / for all init scripts, #181224. 21 Jun 2007; Mike Frysinger <vapier@gentoo.org>: 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) { |