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.
This commit is contained in:
Denis Vlasenko
2007-04-12 12:31:02 +00:00
parent 831a20f512
commit 0de3c55b42
4 changed files with 32 additions and 38 deletions

View File

@ -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)
{