2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Add option for set_perm to not exit on failure and use this in

the logging routines.
This commit is contained in:
Todd C. Miller
2009-05-10 11:52:13 +00:00
parent 2a609b467c
commit 755a81e946
4 changed files with 52 additions and 22 deletions

View File

@@ -371,7 +371,7 @@ log_error(flags, fmt, va_alist)
#endif
/* Become root if we are not already to avoid user interference */
set_perms(PERM_ROOT);
set_perms(PERM_ROOT|PERM_NOEXIT);
/* Expand printf-style format + args. */
evasprintf(&message, fmt, ap);
@@ -555,10 +555,10 @@ send_mail(line)
* (so user cannot kill it) or as the user (for the paranoid).
*/
#ifndef NO_ROOT_MAILER
set_perms(PERM_ROOT);
set_perms(PERM_ROOT|PERM_NOEXIT);
execve(mpath, argv, root_envp);
#else
set_perms(PERM_FULL_USER);
set_perms(PERM_FULL_USER|PERM_NOEXIT);
execv(mpath, argv);
#endif /* NO_ROOT_MAILER */
mysyslog(LOG_ERR, "cannot execute %s: %m", mpath);