Commit Graph

146 Commits

Author SHA1 Message Date
wiz d43e332f1e setup -> set up. 2003-05-14 12:11:03 +00:00
christos c1c48aec57 PR/5544: Anders Magnusson: Init segfaults when hupped in single user.
- fix so that session_db is not de-referenced when null, and other
  possible null pointer dereferences.
- ignore hup and tstp in single user mode.
2003-04-20 17:16:31 +00:00
fvdl 9f959f87e7 Call MAKEDEV with "init" 2003-04-17 18:04:47 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
simonb d9e49feb59 White space nit. 2002-10-04 13:19:05 +00:00
wiz 2fb4b1db52 New sentence, new line. By Robert Elz with minimal fixes. 2002-10-01 13:40:23 +00:00
lukem 6aeb2c119f if RESCUEDIR is defined, use ${RESCUEDIR}/sh as _PATH_ALTSHELL 2002-08-24 01:05:14 +00:00
lukem 9f3703ab9a - use _PATH_ALTSHELL (which defaults to _PATH_BSHELL) as the default ALTSHELL
(as opposed to _PATH_BSHELL), to allow the ALTSHELL to be changed.
- print the full path to the default shell in the ALTSHELL prompt.
2002-08-24 01:02:51 +00:00
lukem a14ac7834b now that we have working rescue tools, there's no need to force
LDSTATIC=-static for init(8) on people who want LDSTATIC=""
2002-08-24 01:00:18 +00:00
christos 0f38e42a7a fix typos that prevented us from cleaning utmpx. Noted by wiz 2002-08-02 14:03:22 +00:00
christos 06596adfbd add utmpx/wtmpx processing support. 2002-07-27 23:49:47 +00:00
mycroft e84a828ff1 In single-user, after taking a signal and having the `shell' die with
SIGKILL, go into an infinite loop (like in the runcom SIGTERM case), on the
assumption that reboot(8) is in the middle of taking the system down.
This fixes `panic: init died' from sysinst.
2002-04-16 01:59:37 +00:00
lukem 447e6b3ec5 crank size of mfs from 512 sectors to 768 sectors (large i386 MAKEDEV) 2002-02-03 12:55:26 +00:00
lukem b7677f4e0e .ifdef SMALLPROG, compile without ALTSHELL and SECURE support 2002-02-03 02:40:14 +00:00
christos 62a708c06d KNF: - use %m always instead of sometimes using strerror()
- space problems in casts
     - don't cast 0, use NULL
     - don't have long lines
     - don't cast malloc
     - use warn/warnx instead of fprintf
     - fix bug where a failed mount_mfs would cause the program to continue.
     - pass lint
2002-01-26 19:50:25 +00:00
lukem d369b2c6a5 fix compilation problems on my alpha 2002-01-23 01:45:41 +00:00
abs c48a08886b Rename MSDOSFS_ROOT to MFS_DEV_IF_NO_CONSOLE, and rework:
- Always attempt mfs dev if missing /dev/console
    - Save and run both MAKEDEV and MAKEDEV.local
    - After creating the mfs dev, mknod() and freopen() /dev/console.
    - If MAKEDEV is missing do not fail out early, but still create the mfs,
      /dev/console.
    - If we hit any errors fail out to single user.
This change _only_ affects systems booting without /dev/console.
2002-01-21 15:57:40 +00:00
abs 83c1ea626b Increase the size of the dev mfs to at least enough for 1.5.2 i386.
bin/15235 by Gavan Fantom.
2002-01-16 18:30:57 +00:00
lukem efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00
wiz 011b3214d5 Sort sections and SEE ALSO. 2001-11-16 11:37:04 +00:00
lukem 684735b97b complete conversion to ANSI C 2001-06-18 01:38:05 +00:00
wiz 73f545bb5b Drop arguments of .Os. 2001-06-05 11:22:41 +00:00
lukem 37a54a1e9c deprecate LOG_ODELAY; it's the default 2001-01-10 03:01:41 +00:00
wiz 4b4b4ba4ae Fix typo in v1.38. 2000-12-30 15:32:19 +00:00
wiz f81de5856b sprinkle some const's 2000-12-30 15:03:23 +00:00
wiz 369f36b84f ANSIfy and de-__P() 2000-12-30 15:01:42 +00:00
wiz fb109fb5fa Handle NULL return value by fgets after shell prompt better. Also
improve '\n' slightly. Addresses bin/11847.
2000-12-30 14:46:21 +00:00
simonb 9b22175a26 Remove INSTALLFLAGS=-fschg, as per change to usr.bin/ssh/ssh/Makefile. 2000-10-18 00:24:18 +00:00
lukem 1bc94d695d document the conditions for /etc/rc to be called with "autoboot" 2000-04-29 00:47:06 +00:00
lukem 9b544a7c6d Using the `NOTES' file and source code as a reference, attempt to more
accurately explain the operation of init(8)'s state machine.
2000-04-26 15:01:36 +00:00
soren b742cb0638 The mode 0544 workaround has not been necessary since the first BSDi import. 2000-03-19 23:22:55 +00:00
soren c9e138cf30 Remove reference to crash(8). 2000-03-19 23:22:07 +00:00
soren 7c2de1e4cf Unbreak compilation with -DLETS_GET_SMALL as in PR bin/9639 by Patrick Welche. 2000-03-19 23:21:46 +00:00
mycroft f5d7100e26 Nuke `extern int errno;' in code we compile with -Wstrict-prototypes. We get
the correct definition from errno.h.
2000-01-21 17:08:33 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
bouyer 3e19888633 Note that proc.<pid>.corename susctl node is read-only at securelevel >= 2. 1999-09-28 14:56:04 +00:00
tls f6f55150e7 document ipf change at securelevel >= 2 1998-11-14 07:47:36 +00:00
tls 88aaa797c9 reflect new securelevel 2 changes 1998-11-14 07:25:35 +00:00
tls 566ff31cb7 When downgrading from 'highly secure' mode (securelevel >= 2) to 'insecure' mode (securelevel 0) and the root password is set, always require it before giving a shell on the console. Reasoning: if an attacker has access to the machine console, he doesn't necessarily have access to the hardware itself; on a 'highly secure' machine, we may as well make his life hard. 1998-11-14 07:17:58 +00:00
thorpej cad7a502b7 Use sigset_t for signal masks. 1998-09-18 22:00:46 +00:00
perry e5fb973688 fix a typo, pointed out in pr-5785 from Mason Loring Bliss 1998-07-17 23:07:10 +00:00
msaitoh a466559c34 fix a bug. 1998-05-25 10:48:12 +00:00
fair 42aff08cb4 fix a bad .Xr 1998-04-29 19:25:25 +00:00
fair 3d7afc6d03 fix bad .Xr references 1998-04-29 09:49:10 +00:00
mycroft 4462053ab3 Fill in missing (default) mmap(2) flags. 1998-02-20 09:27:18 +00:00
perry dd1e2b895e fix pr4766 from greywolf -- couldn't build without -DALTSHELL 1998-02-06 19:30:14 +00:00
drochner 6c0cd4bbaf Remove the "wait for mfs to be mounted" hack; this is solved in mount_mfs
now.
1997-11-01 22:15:54 +00:00
christos 55f6ba0cb0 PR/4372: Andread Wrede: increase number of inodes in mfs 1997-10-28 22:52:52 +00:00
mycroft af65e81265 Make these executables world-readable. 1997-10-11 11:05:28 +00:00
enami e19615eae4 Sort items of section 8 in SEE ALSO list alphabetical order. 1997-10-11 03:02:36 +00:00
christos e230a48b57 CFLAGS->CPPFLAGS 1997-10-10 19:47:50 +00:00
lukem 2ddc10a0ab define WARNS?=1 for all of sbin/* 1997-09-15 12:45:47 +00:00
lukem 7da448585a cleanup use of .Nm 1997-09-15 01:56:08 +00:00
christos 374857e89f Support root on msdos filesystems by creating an mfs on /dev and running
MAKEDEV all to create the devices. Idea by Chris Demetriou.
1997-07-30 03:43:19 +00:00
perry 3f2367bf01 add WARN=1 1997-07-19 19:00:58 +00:00
perry ba588d9705 get rid of "register" declarations.
turn 0 pointers into NULLs
Fix WARN=1 warnings
1997-07-19 19:00:44 +00:00
perry 2cb2701a4e rename DEBUGSHELL to ALTSHELL 1997-07-19 18:12:47 +00:00
perry 53222a55ef 1) change rcsid[] and copyright[] to use __RCSID and __COPYRIGHT
macros.
2) Clean up some gratuitous uses of write() instead of fprintf()
3) Clean up some of the alternative shell code in single_user(),
   fixing a couple of bugs in the meanwhile. Also, fix pr-2620 from
   Chris Demetriou -- when an alternative shell is exec'ed, it is now
   not called "-sh" automatically.
4) rename the DEBUGSHELL option ALTSHELL since its almost always used
   in NetBSD.

Notes:
1) It isn't clear that the ALTSHELL code is really ever very useful,
   but we seem to have decided to always enable it anyway.
2) The code in init really needs an overall cleanup, but I just don't
   have time or energy.
1997-07-19 18:11:59 +00:00
perry f40020042e merge lite-2 changes 1997-07-19 17:06:29 +00:00
perry e47e6a8f47 in NetBSD, setting the clock back is inhibited in securelevel 2, not s-lev 1 1997-07-19 16:58:47 +00:00
perry dfc8543445 (mostly) merge lite-2 changes (except for some silly ones.) 1997-07-19 16:51:40 +00:00
phil ef45808de9 Better specify which flags can't be change at level 1. (PR 3299)
Make all "multiuser" be "multi-user" to conform with other "multi-user"
usage.
1997-06-30 20:30:06 +00:00
mycroft 7f2e03747e Insert some closelog()s, so we don't leave the syslog socket
on fd 0.
1997-03-14 00:44:35 +00:00
thorpej dd72c4e12f If root has no password, don't lock the operator out of single-user
mode if the console is "insecure".
1997-02-22 02:19:51 +00:00
perry 7665c8ee25 close pr-2717 from Manuel Bouyer <bouyer@lix.polytechnique.fr>
Replaces reference to hand patching securelevel kernel variable
with reference to options INSECURE.
1997-01-17 02:56:27 +00:00
jtc e54ce8e1bd Updated to use <util.h>.
From Greg Hudson <ghudson@MIT.EDU>.
1996-05-15 23:29:33 +00:00
mycroft e160549f5b Kill sessions that were deleted when rereading /etc/ttys. 1995-10-05 06:11:24 +00:00
jtc ec38846844 sys_siglist[] -> strsignal() 1995-05-28 05:25:34 +00:00
cgd 0114e805ce convert to new RCS Id conventions; reduce my headache 1995-03-18 14:54:19 +00:00
cgd 06e2955ff1 specify man pages the new way. 1994-12-22 10:44:04 +00:00
mycroft c741ceaa58 Changes to match POSIXication of kill(1). 1994-09-23 23:18:36 +00:00
mycroft ea7b5d4ec6 Eliminate uses of some obsolete functions. 1994-09-23 14:26:58 +00:00
deraadt ae5b446f1c ensure /sbin is in PATH in single user mode 1994-08-06 06:26:44 +00:00
mycroft c250a07889 Fix up RCS ids. 1994-06-11 07:50:42 +00:00
pk 80c7c7ee1a Update to 4.4-lite (basically some copyright changes) + local changes. 1994-06-10 18:06:15 +00:00
mycroft 04117b8e3e Clean up deleted files. 1994-06-10 18:06:14 +00:00
pk ed2fab3b01 Update to 4.4-lite (basically some copyright changes) + local changes. 1994-06-10 18:06:09 +00:00
pk 7ed52d1091 Disabling *all* terminals in /etc/ttys meant disabling them for good:
stuck in `clean tty' => `multi user' => `clean tty' loop.
1994-04-26 19:56:22 +00:00
cgd 57a340a4a2 if we want a LETS_GET_SMALL init, allow only single-user 1994-04-18 07:59:40 +00:00
cgd fadc1f548f Establish an initial user so that programs running single user
do not freak out and die (like passwd).
1994-03-01 00:32:20 +00:00
cgd 4b30c543a0 always use libcrypt 1993-10-07 02:16:39 +00:00
cgd f08e3f34a5 merge in changes from netbsd-0-9-ALPHA2 1993-08-07 07:42:13 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft dfb9caab49 Add RCS indentifiers. 1993-08-01 07:32:48 +00:00
mycroft cda4f8f6ee Add RCS identifiers. 1993-08-01 05:37:30 +00:00
cgd 6fe7777e0e 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.
1993-07-08 01:47:31 +00:00
cgd c15a7d06cd a couple of local mods; always ask for shell in single user, use -lcrypt,
use root's shell rather that /bin/sh when going to single-user, etc.
1993-06-18 21:16:25 +00:00
cgd a63ff5217e incorporate bsdi's version of init; this is their version, w/no local changes
other than adding Id strings as appropriate
1993-06-18 20:51:45 +00:00
cgd b907fbcbb9 add preliminary support for devfs (e.g. MOUNT_DEVFS #define, etc.) 1993-06-10 01:02:59 +00:00
cgd 6ebc3bcac9 changed to use new libcrypt scheme. 1993-04-26 14:54:38 +00:00
cgd c454963975 added console security, if SECURE_CONSOLE defined in makefile,
and console not secure in ttys
1993-04-06 19:33:33 +00:00
cgd adfcb79c96 added secure init patch 1993-03-23 08:17:35 +00:00
cgd 06be60083d changed "Id" to "Header" for rcsids 1993-03-23 00:22:59 +00:00
cgd 346aa5dd48 added rcs ids to all files 1993-03-22 08:04:00 +00:00
cgd e541169ce2 after 0.2.2 "stable" patches applied 1993-03-21 18:04:42 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00