* (so user cannot kill it) or as the user (for the paranoid).
*/
#ifndef NO_ROOT_MAILER
- set_perms(PERM_FULL_ROOT);
+ set_perms(PERM_ROOT);
execve(mpath, argv, root_envp);
#else
set_perms(PERM_FULL_USER);
}
/* become a daemon */
- set_perms(PERM_FULL_ROOT);
+ set_perms(PERM_ROOT);
if (setsid() == -1) {
warning("setsid");
kill(pid, SIGKILL);
int perm;
{
switch (perm) {
- case PERM_FULL_ROOT:
case PERM_ROOT:
if (setresuid(ROOT_UID, ROOT_UID, ROOT_UID))
errorx(1, "setresuid(ROOT_UID, ROOT_UID, ROOT_UID) failed, your operating system may have a broken setresuid() function\nTry running configure with --disable-setresuid");
int perm;
{
switch (perm) {
- case PERM_FULL_ROOT:
case PERM_ROOT:
if (setreuid(-1, ROOT_UID))
errorx(1, "setreuid(-1, ROOT_UID) failed, your operating system may have a broken setreuid() function\nTry running configure with --disable-setreuid");
error(1, "setuid(ROOT_UID)");
switch (perm) {
- case PERM_FULL_ROOT:
case PERM_ROOT:
/* already set above */
break;
{
switch (perm) {
- case PERM_FULL_ROOT:
case PERM_ROOT:
if (setuid(ROOT_UID))
error(1, "setuid(ROOT_UID)");
* Used with set_perms()
*/
#define PERM_ROOT 0x00
-#define PERM_FULL_ROOT 0x01
-#define PERM_USER 0x02
-#define PERM_FULL_USER 0x03
-#define PERM_SUDOERS 0x04
-#define PERM_RUNAS 0x05
-#define PERM_FULL_RUNAS 0x06
-#define PERM_TIMESTAMP 0x07
+#define PERM_USER 0x01
+#define PERM_FULL_USER 0x02
+#define PERM_SUDOERS 0x03
+#define PERM_RUNAS 0x04
+#define PERM_FULL_RUNAS 0x05
+#define PERM_TIMESTAMP 0x06
/*
* Shortcuts for sudo_user contents.