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
2012-06-12 13:21:02 +02:00
committed by Denys Vlasenko
parent 588e284f53
commit 70fc8c17e2
5 changed files with 11 additions and 7 deletions

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 = '/';