current_euid = geteuid();
restrict_access_init(&rset);
restrict_access_get_env(&rset);
+ rset.allow_setuid_root = keep_setuid_root;
if (priv->uid != (uid_t)-1) {
rset.uid = priv->uid;
rset.uid_source = priv->uid_source;
is_root = geteuid() == 0;
if (!is_root &&
- set->drop_setuid_root &&
+ !set->allow_setuid_root &&
getuid() == 0) {
/* recover current effective UID */
if (target_uid == (uid_t)-1)
/* Chroot directory */
const char *chroot_dir;
- /* Set TRUE to attempt to drop any root privileges
- FIXME: Reverse logic on v2.3 */
- bool drop_setuid_root;
+ /* Allow running in setuid-root mode, where real UID is root and
+ * effective UID is non-root. By default the real UID is changed
+ * to be the same as the effective UID. */
+ bool allow_setuid_root;
};
/* Initialize settings with values that don't change anything. */