diff options
author | Todd C. Miller <Todd.Miller@courtesan.com> | 1994-08-01 17:39:53 +0000 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@courtesan.com> | 1994-08-01 17:39:53 +0000 |
commit | fa34d10fb9d178c05867478630b1d3fc2ca8e20b (patch) | |
tree | 176230c9837b036cf9169c46764bbfed3f17604f | |
parent | 2fb8f9ae49640e90bcd3364a01d269bc658945ea (diff) | |
download | sudo-fa34d10fb9d178c05867478630b1d3fc2ca8e20b.tar.gz |
now print error if chdir fails
-rw-r--r-- | sudo_realpath.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sudo_realpath.c b/sudo_realpath.c index 76b8041a4..060f13bf4 100644 --- a/sudo_realpath.c +++ b/sudo_realpath.c @@ -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; } |