← Commit list

976690afe

Denis Vlasenko
Denis Vlasenko
2007-09-10
FAILED Duration: 22s

Subject

run_shell: code shrink for selinux

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/run_shell.c+5 -7
@@ -39,15 +39,13 @@ static security_context_t current_sid;
void
renew_current_security_context(void)
{
- if (current_sid)
- freecon(current_sid); /* Release old context */
+ freecon(current_sid); /* Release old context */
getcon(&current_sid); /* update */
}
void
set_current_security_context(security_context_t sid)
{
- if (current_sid)
- freecon(current_sid); /* Release old context */
+ freecon(current_sid); /* Release old context */
current_sid = sid;
}
@@ -84,10 +82,10 @@ void run_shell(const char *shell, int loginshell, const char *command, const cha
}
args[argno] = NULL;
#if ENABLE_SELINUX
- if (current_sid && !setexeccon(current_sid)) {
+ if (current_sid)
+ setexeccon(current_sid);
+ if (ENABLE_FEATURE_CLEAN_UP)
freecon(current_sid);
- execve(shell, (char **) args, environ);
- } else
#endif
execv(shell, (char **) args);
bb_perror_msg_and_die("cannot run %s", shell);