diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-12 16:31:02 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-12 16:31:02 +0400 |
commit | 0de3c55b4286498753751b7cd63f3af12f0ebd0f (patch) | |
tree | cf080409fa9b904793fb19d397e7f0d9fb17a936 /libbb/setup_environment.c | |
parent | 831a20f51246cd8d54a246ba7e239a062eeb002c (diff) |
login: remove setpgrp call (makes it work from shell prompt again).
login: sanitize stdio descriptors (we are suid, need to be careful!)
shrink login and set_environment by ~100 bytes.
Diffstat (limited to 'libbb/setup_environment.c')
-rw-r--r-- | libbb/setup_environment.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index 874a58efa..18d5a0610 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c @@ -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" - - -#define DEFAULT_LOGIN_PATH "/bin:/usr/bin" -#define DEFAULT_ROOT_LOGIN_PATH "/usr/sbin:/bin:/usr/bin:/sbin" +/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, + * but I want to save a few bytes here */ +static const char DEFAULT_ROOT_LOGIN_PATH[] = "/sbin:/usr/sbin:/bin:/usr/bin"; +#define DEFAULT_LOGIN_PATH (DEFAULT_ROOT_LOGIN_PATH + sizeof("/sbin:/usr/sbin")) void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw) { |