su: do not change to home dir unless -l

Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Pascal Bellard authored and Denys Vlasenko committed 2012-06-12 13:21:02 +02:00
1 parent 588e284f53
commit 70fc8c17e2
5 files changed
+11 -7

No files matched your search

+1 -1
View File
@@ -1414,7 +1414,7 @@ static void send_cgi_and_exit(
if (script != url) { /* paranoia */
*script = '\0';
if (chdir(url + 1) != 0) {
bb_perror_msg("chdir(%s)", url + 1);
bb_perror_msg("can't change directory to '%s'", url + 1);
goto error_execing_cgi;
}
// not needed: *script = '/';