mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
now print error if chdir fails
This commit is contained in:
parent
3c318d8ae4
commit
35d838c688
@ -208,7 +208,11 @@ static void realpath_restore(cwd)
|
||||
|
||||
/* relinquish root privs and chdir to where we started... */
|
||||
be_user();
|
||||
(void) chdir(cwd);
|
||||
if (chdir(cwd)) {
|
||||
fprintf(stderr, "Error: cannot change dir back to %s, sudo aborting!\n",
|
||||
cwd);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
errno = old_errno;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user