diff options
author | Denis Vlasenko | 2007-04-12 12:31:02 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-04-12 12:31:02 +0000 |
commit | 0de3c55b4286498753751b7cd63f3af12f0ebd0f (patch) | |
tree | cf080409fa9b904793fb19d397e7f0d9fb17a936 /libbb | |
parent | 831a20f51246cd8d54a246ba7e239a062eeb002c (diff) | |
download | busybox-0de3c55b4286498753751b7cd63f3af12f0ebd0f.zip busybox-0de3c55b4286498753751b7cd63f3af12f0ebd0f.tar.gz |
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')
-rw-r--r-- | libbb/info_msg.c | 4 | ||||
-rw-r--r-- | libbb/setup_environment.c | 15 |
2 files changed, 4 insertions, 15 deletions
diff --git a/libbb/info_msg.c b/libbb/info_msg.c index 78d5c8f..c763ce6 100644 --- a/libbb/info_msg.c +++ b/libbb/info_msg.c @@ -7,10 +7,6 @@ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ -#include <stdio.h> -#include <errno.h> -#include <string.h> -#include <stdlib.h> #include "libbb.h" void bb_info_msg(const char *s, ...) diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index 874a58e..18d5a06 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) { |