version 1.21, 2008/11/14 11:58:08 |
version 1.22, 2009/06/21 14:48:42 |
|
|
/* |
/* |
* Copyright (c) 1994-1996, 1998-2008 Todd C. Miller <Todd.Miller@courtesan.com> |
* Copyright (c) 1994-1996, 1998-2009 Todd C. Miller <Todd.Miller@courtesan.com> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
#include "sudo.h" |
#include "sudo.h" |
|
|
#ifndef lint |
#ifndef lint |
__unused static const char rcsid[] = "$Sudo: logging.c,v 1.203 2008/11/09 14:13:12 millert Exp $"; |
__unused static const char rcsid[] = "$Sudo: logging.c,v 1.205 2009/05/25 12:02:41 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
static void do_syslog __P((int, char *)); |
static void do_syslog __P((int, char *)); |
|
|
#endif |
#endif |
|
|
/* Become root if we are not already to avoid user interference */ |
/* 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. */ |
/* Expand printf-style format + args. */ |
evasprintf(&message, fmt, ap); |
evasprintf(&message, fmt, ap); |
|
|
* (so user cannot kill it) or as the user (for the paranoid). |
* (so user cannot kill it) or as the user (for the paranoid). |
*/ |
*/ |
#ifndef NO_ROOT_MAILER |
#ifndef NO_ROOT_MAILER |
set_perms(PERM_ROOT); |
set_perms(PERM_ROOT|PERM_NOEXIT); |
execve(mpath, argv, root_envp); |
execve(mpath, argv, root_envp); |
#else |
#else |
set_perms(PERM_FULL_USER); |
set_perms(PERM_FULL_USER|PERM_NOEXIT); |
execv(mpath, argv); |
execv(mpath, argv); |
#endif /* NO_ROOT_MAILER */ |
#endif /* NO_ROOT_MAILER */ |
mysyslog(LOG_ERR, "cannot execute %s: %m", mpath); |
mysyslog(LOG_ERR, "cannot execute %s: %m", mpath); |