Use a flag bit in struct command_details for selinux instead of a separate

field.
This commit is contained in:
Todd C. Miller
2010-06-09 16:25:44 -04:00
parent 4c1ef12648
commit 34613c8465
4 changed files with 7 additions and 7 deletions

View File

@@ -594,7 +594,7 @@ command_info_to_details(char * const info[], struct command_details *details)
#ifdef HAVE_SELINUX
if (details->selinux_role != NULL && is_selinux_enabled() > 0)
details->selinux_enabled = TRUE;
SET(details->flags, CD_RBAC_ENABLED);
#endif
}
@@ -655,7 +655,7 @@ exec_setup(struct command_details *details, const char *ptyname, int ptyfd)
}
#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;