now print error if chdir fails
This commit is contained in:
@@ -208,7 +208,11 @@ static void realpath_restore(cwd)
|
|||||||
|
|
||||||
/* relinquish root privs and chdir to where we started... */
|
/* relinquish root privs and chdir to where we started... */
|
||||||
be_user();
|
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;
|
errno = old_errno;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user