get rid of the bogus changes i made to init. note that /etc/ttys
*must* have an entry for "console", though it should be "off", prolly.
This commit is contained in:
parent
8eb8b462ea
commit
6fe7777e0e
|
@ -1,11 +1,11 @@
|
|||
# from: @(#)Makefile 5.3 (Berkeley) 5/11/90
|
||||
# from: BSDI Id: Makefile,v 1.3 1993/06/14 20:06:22 donn Exp
|
||||
# $Id: Makefile,v 1.8 1993/06/18 21:16:25 cgd Exp $
|
||||
# $Id: Makefile,v 1.9 1993/07/08 01:47:31 cgd Exp $
|
||||
|
||||
PROG= init
|
||||
MAN8= init.0
|
||||
# XXX fix this when we have KERN_SECURELVL
|
||||
CFLAGS+=-DSECURE -DNOSYSCTL -DDEBUGSHELL -DCONSOLENAME=\"vga\"
|
||||
CFLAGS+=-DSECURE -DNOSYSCTL -DDEBUGSHELL
|
||||
DPADD= ${LIBUTIL}
|
||||
LDADD= -lutil
|
||||
.ifndef EXPORTABLE_SYSTEM
|
||||
|
|
|
@ -42,7 +42,7 @@ char copyright[] =
|
|||
|
||||
#ifndef lint
|
||||
/* from: static char sccsid[] = "@(#)init.c 6.22 (Berkeley) 6/2/93"; */
|
||||
static char rcsid[] = "$Id: init.c,v 1.9 1993/06/18 21:16:26 cgd Exp $";
|
||||
static char rcsid[] = "$Id: init.c,v 1.10 1993/07/08 01:47:33 cgd Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -73,10 +73,6 @@ static char rcsid[] = "$Id: init.c,v 1.9 1993/06/18 21:16:26 cgd Exp $";
|
|||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#ifndef CONSOLENAME
|
||||
#define CONSOLENAME "console"
|
||||
#endif
|
||||
|
||||
#include "pathnames.h"
|
||||
|
||||
/*
|
||||
|
@ -547,9 +543,9 @@ single_user()
|
|||
sigset_t mask;
|
||||
char *shell = _PATH_BSHELL;
|
||||
char *argv[2];
|
||||
struct passwd *pp;
|
||||
#ifdef SECURE
|
||||
struct ttyent *typ;
|
||||
struct passwd *pp;
|
||||
static const char banner[] =
|
||||
"Enter root password, or ^D to go multi-user\n";
|
||||
char *clear, *password;
|
||||
|
@ -567,14 +563,14 @@ single_user()
|
|||
*/
|
||||
setctty(_PATH_CONSOLE);
|
||||
|
||||
pp = getpwnam("root");
|
||||
#ifdef SECURE
|
||||
/*
|
||||
* Check the root password.
|
||||
* We don't care if the console is 'on' by default;
|
||||
* it's the only tty that can be 'off' and 'secure'.
|
||||
*/
|
||||
typ = getttynam(CONSOLENAME);
|
||||
typ = getttynam("console");
|
||||
pp = getpwnam("root");
|
||||
if (typ && (typ->ty_status & TTY_SECURE) == 0 && pp) {
|
||||
write(2, banner, sizeof banner - 1);
|
||||
for (;;) {
|
||||
|
@ -589,10 +585,8 @@ single_user()
|
|||
}
|
||||
}
|
||||
endttyent();
|
||||
#endif /* SECURE */
|
||||
if (pp && pp->pw_shell && (pp->pw_shell[0] != '\0'))
|
||||
shell = pp->pw_shell;
|
||||
endpwent();
|
||||
#endif /* SECURE */
|
||||
|
||||
#ifdef DEBUGSHELL
|
||||
{
|
||||
|
@ -600,13 +594,9 @@ single_user()
|
|||
int num;
|
||||
|
||||
#define SHREQUEST \
|
||||
"Enter pathname of shell or RETURN for "
|
||||
"Enter pathname of shell or RETURN for sh: "
|
||||
(void)write(STDERR_FILENO,
|
||||
SHREQUEST, sizeof(SHREQUEST) - 1);
|
||||
(void)write(STDERR_FILENO,
|
||||
shell, strlen(shell));
|
||||
(void)write(STDERR_FILENO,": ", 2);
|
||||
|
||||
while ((num = read(STDIN_FILENO, cp, 1)) != -1 &&
|
||||
num != 0 && *cp != '\n' && cp < &altshell[127])
|
||||
cp++;
|
||||
|
|
Loading…
Reference in New Issue