field.
if (details->closefrom >= 0)
closefrom(details->closefrom);
#ifdef HAVE_SELINUX
- if (details->selinux_enabled)
+ if (ISSET(details->flags, CD_RBAC_ENABLED))
selinux_execve(details->command, argv, envp);
else
#endif
}
#ifdef HAVE_SELINUX
- if (details->selinux_enabled) {
+ if (ISSET(details->flags, CD_RBAC_ENABLED)) {
/* This is probably not needed in log_io mode. */
if (selinux_restore_tty() != 0)
warningx("unable to restore tty label");
if (details->closefrom >= 0)
closefrom(details->closefrom);
#ifdef HAVE_SELINUX
- if (details->selinux_enabled)
+ if (ISSET(details->flags, CD_RBAC_ENABLED))
selinux_execve(details->command, argv, envp);
else
#endif
#ifdef HAVE_SELINUX
if (details->selinux_role != NULL && is_selinux_enabled() > 0)
- details->selinux_enabled = TRUE;
+ SET(details->flags, CD_RBAC_ENABLED);
#endif
}
}
#ifdef HAVE_SELINUX
- if (details->selinux_enabled) {
+ if (ISSET(details->flags, CD_RBAC_ENABLED)) {
if (selinux_setup(details->selinux_role, details->selinux_type,
ptyname ? ptyname : user_details.tty, ptyfd) == -1)
goto done;
#define CD_SET_TIMEOUT 0x0100
#define CD_SUDOEDIT 0x0200
#define CD_BACKGROUND 0x0400
+#define CD_RBAC_ENABLED 0x0800
struct command_details {
uid_t uid;
int timeout;
int ngroups;
int closefrom;
- short flags;
- short selinux_enabled;
+ int flags;
GETGROUPS_T *groups;
const char *command;
const char *cwd;