use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228) Total: -89 bytes
This commit is contained in:
parent
c2f011aa03
commit
fad2b86c9e
16 changed files with 23 additions and 83 deletions
|
@ -28,19 +28,12 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <ctype.h>
|
||||
#include "libbb.h"
|
||||
#ifdef CONFIG_SELINUX
|
||||
#if ENABLE_SELINUX
|
||||
#include <selinux/selinux.h> /* for setexeccon */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SELINUX
|
||||
#if ENABLE_SELINUX
|
||||
static security_context_t current_sid;
|
||||
|
||||
void
|
||||
|
@ -90,7 +83,7 @@ void run_shell(const char *shell, int loginshell, const char *command, const cha
|
|||
args[argno++] = *additional_args;
|
||||
}
|
||||
args[argno] = NULL;
|
||||
#ifdef CONFIG_SELINUX
|
||||
#if ENABLE_SELINUX
|
||||
if (current_sid && !setexeccon(current_sid)) {
|
||||
freecon(current_sid);
|
||||
execve(shell, (char **) args, environ);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue