static void runas_setup __P((void));
static void fatal __P((char *));
+#if defined(_SC_SAVED_IDS) && defined(_SC_VERSION)
/*
* Set real and effective uids and gids based on perm.
* Since we have POSIX saved IDs we can get away with just
* toggling the effective uid/gid unless we are headed for an exec().
*/
void
-set_perms_saved_uid(perm, sudo_mode)
+set_perms_posix(perm, sudo_mode)
int perm;
int sudo_mode;
{
break;
}
}
+#endif /* _SC_SAVED_IDS && _SC_VERSION */
+#ifdef HAVE_SETREUID
/*
* Set real and effective uids and gids based on perm.
* We always retain a real or effective uid of 0 unless
* we are headed for an exec().
*/
void
-set_perms_setreuid(perm, sudo_mode)
+set_perms_fallback(perm, sudo_mode)
int perm;
int sudo_mode;
{
}
}
-#ifndef HAVE_SETREUID
+#else
+
/*
* Set real and effective uids and gids based on perm.
* NOTE: does not support the "stay_setuid" option.
/* Set set_perms pointer to the correct function */
#if defined(_SC_SAVED_IDS) && defined(_SC_VERSION)
if (sysconf(_SC_SAVED_IDS) == 1 && sysconf(_SC_VERSION) >= 199009)
- set_perms = set_perms_saved_uid;
+ set_perms = set_perms_posix;
else
#endif
-#ifdef HAVE_SETREUID
- set_perms = set_perms_setreuid;
-#else
- set_perms = set_perms_fallback;
-#endif
+ set_perms = set_perms_fallback;
}
#ifdef HAVE_LOGIN_CAP_H
void check_user __P((void));
void verify_user __P((struct passwd *, char *));
int sudoers_lookup __P((int));
-void set_perms_saved_uid __P((int, int));
-void set_perms_setreuid __P((int, int));
+void set_perms_posix __P((int, int));
void set_perms_fallback __P((int, int));
void remove_timestamp __P((int));
int check_secureware __P((char *));