From 0de3c55b4286498753751b7cd63f3af12f0ebd0f Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 12 Apr 2007 12:31:02 +0000 Subject: 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. --- libbb/info_msg.c | 4 ---- libbb/setup_environment.c | 15 ++++----------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'libbb') diff --git a/libbb/info_msg.c b/libbb/info_msg.c index 78d5c8f32..c763ce60c 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 -#include -#include -#include #include "libbb.h" void bb_info_msg(const char *s, ...) 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 -#include -#include -#include -#include -#include -#include #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) { -- cgit v1.2.3