diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-05-31 22:16:38 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-05-31 22:16:38 +0000 |
commit | 3ea433409694393b67dd9dee3b184268ab75ac56 (patch) | |
tree | f2d3fe127fb6c3c1d3b919631de6e6ed7cbc1791 /libbb/run_shell.c | |
parent | 2c31c731f0026b9f92dc0e07542fb8e38cad7dd2 (diff) | |
download | busybox-w32-3ea433409694393b67dd9dee3b184268ab75ac56.tar.gz busybox-w32-3ea433409694393b67dd9dee3b184268ab75ac56.tar.bz2 busybox-w32-3ea433409694393b67dd9dee3b184268ab75ac56.zip |
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
git-svn-id: svn://busybox.net/trunk/busybox@18716 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb/run_shell.c')
-rw-r--r-- | libbb/run_shell.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libbb/run_shell.c b/libbb/run_shell.c index 6be09088d..25d55dd63 100644 --- a/libbb/run_shell.c +++ b/libbb/run_shell.c | |||
@@ -28,19 +28,12 @@ | |||
28 | * SUCH DAMAGE. | 28 | * SUCH DAMAGE. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <stdio.h> | ||
32 | #include <errno.h> | ||
33 | #include <unistd.h> | ||
34 | #include <string.h> | ||
35 | #include <stdlib.h> | ||
36 | #include <syslog.h> | ||
37 | #include <ctype.h> | ||
38 | #include "libbb.h" | 31 | #include "libbb.h" |
39 | #ifdef CONFIG_SELINUX | 32 | #if ENABLE_SELINUX |
40 | #include <selinux/selinux.h> /* for setexeccon */ | 33 | #include <selinux/selinux.h> /* for setexeccon */ |
41 | #endif | 34 | #endif |
42 | 35 | ||
43 | #ifdef CONFIG_SELINUX | 36 | #if ENABLE_SELINUX |
44 | static security_context_t current_sid; | 37 | static security_context_t current_sid; |
45 | 38 | ||
46 | void | 39 | void |
@@ -90,7 +83,7 @@ void run_shell(const char *shell, int loginshell, const char *command, const cha | |||
90 | args[argno++] = *additional_args; | 83 | args[argno++] = *additional_args; |
91 | } | 84 | } |
92 | args[argno] = NULL; | 85 | args[argno] = NULL; |
93 | #ifdef CONFIG_SELINUX | 86 | #if ENABLE_SELINUX |
94 | if (current_sid && !setexeccon(current_sid)) { | 87 | if (current_sid && !setexeccon(current_sid)) { |
95 | freecon(current_sid); | 88 | freecon(current_sid); |
96 | execve(shell, (char **) args, environ); | 89 | execve(shell, (char **) args, environ); |