be_root/be_user is now down in sudo_realpath()
This commit is contained in:
@@ -375,17 +375,11 @@ static void send_mail()
|
||||
(void) bzero((char *)(&action), sizeof(action));
|
||||
#endif /* POSIX_SIGNALS */
|
||||
|
||||
/* become root for find_path() */
|
||||
be_root();
|
||||
|
||||
if ((mailer = find_path(mailer)) == NULL) {
|
||||
(void) fprintf(stderr, "%s: mailer (%s) not found\n", Argv[0], mailer);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* relinquish root */
|
||||
be_user();
|
||||
|
||||
/* catch children as they die */
|
||||
#ifdef POSIX_SIGNALS
|
||||
action.sa_handler = reapchild;
|
||||
|
3
sudo.c
3
sudo.c
@@ -294,10 +294,7 @@ static void load_globals()
|
||||
cmnd = "validate";
|
||||
} else {
|
||||
strncpy(path, Argv[1], MAXPATHLEN)[MAXPATHLEN] = 0;
|
||||
/* become root for find_path() only */
|
||||
be_root();
|
||||
cmnd = find_path(path); /* get the absolute path */
|
||||
be_user();
|
||||
if (cmnd == NULL) {
|
||||
(void) fprintf(stderr, "%s: %s: command not found\n", Argv[0], Argv[1]);
|
||||
exit(1);
|
||||
|
Reference in New Issue
Block a user