be_root/be_user is now down in sudo_realpath()

This commit is contained in:
Todd C. Miller
1994-07-25 22:32:30 +00:00
parent 7b70cafbb2
commit 2624e7ee72
2 changed files with 0 additions and 9 deletions

View File

@@ -375,17 +375,11 @@ static void send_mail()
(void) bzero((char *)(&action), sizeof(action)); (void) bzero((char *)(&action), sizeof(action));
#endif /* POSIX_SIGNALS */ #endif /* POSIX_SIGNALS */
/* become root for find_path() */
be_root();
if ((mailer = find_path(mailer)) == NULL) { if ((mailer = find_path(mailer)) == NULL) {
(void) fprintf(stderr, "%s: mailer (%s) not found\n", Argv[0], mailer); (void) fprintf(stderr, "%s: mailer (%s) not found\n", Argv[0], mailer);
exit(1); exit(1);
} }
/* relinquish root */
be_user();
/* catch children as they die */ /* catch children as they die */
#ifdef POSIX_SIGNALS #ifdef POSIX_SIGNALS
action.sa_handler = reapchild; action.sa_handler = reapchild;

3
sudo.c
View File

@@ -294,10 +294,7 @@ static void load_globals()
cmnd = "validate"; cmnd = "validate";
} else { } else {
strncpy(path, Argv[1], MAXPATHLEN)[MAXPATHLEN] = 0; strncpy(path, Argv[1], MAXPATHLEN)[MAXPATHLEN] = 0;
/* become root for find_path() only */
be_root();
cmnd = find_path(path); /* get the absolute path */ cmnd = find_path(path); /* get the absolute path */
be_user();
if (cmnd == NULL) { if (cmnd == NULL) {
(void) fprintf(stderr, "%s: %s: command not found\n", Argv[0], Argv[1]); (void) fprintf(stderr, "%s: %s: command not found\n", Argv[0], Argv[1]);
exit(1); exit(1);