aboutsummaryrefslogtreecommitdiff
path: root/libbb/run_shell.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-05-31 22:16:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-05-31 22:16:38 +0000
commitfad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd (patch)
treef2d3fe127fb6c3c1d3b919631de6e6ed7cbc1791 /libbb/run_shell.c
parentc2f011aa031b8598422953d5e9a93ca008ad0867 (diff)
downloadbusybox-w32-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.tar.gz
busybox-w32-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.tar.bz2
busybox-w32-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.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
Diffstat (limited to 'libbb/run_shell.c')
-rw-r--r--libbb/run_shell.c13
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
44static security_context_t current_sid; 37static security_context_t current_sid;
45 38
46void 39void
@@ -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);