Commit Graph

125 Commits

Author SHA1 Message Date
rumble
e948e1b17f Check for allocation failures in malloc, calloc, realloc, asprintf, and
vasprintf and try to handle them.
2006-03-17 15:53:46 +00:00
chris
4727225848 Fix case where argv wasn't returned or freed.
This fixes Coverity CID 2023.

While here also return NULL if the malloc fails.
2006-03-17 02:48:29 +00:00
elad
03e754fd4d The securelevel does not affect whether Veriexec's tables can be modified;
this is now controlled by Veriexec's strict level.
2005-11-13 18:39:53 +00:00
wiz
d0b93cc137 Mark up more paths with .Pa, and
break a line (<=80 chars per line).
2005-07-01 17:07:33 +00:00
snj
23b31bb2ee Use more macros and sort xrefs. 2005-06-30 21:36:34 +00:00
christos
fdfc4891f9 Patch from Jeremy Reed to describe how MFS /dev works. Thanks! 2005-06-30 16:38:06 +00:00
christos
2c6eadc9ce Move WARNS=3 to the Makefile.inc, and add a little const to the remaining
programs that did not compile before.
2005-06-27 01:00:04 +00:00
peter
a9b411c198 Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.
2005-06-20 13:25:23 +00:00
abs
446520f017 Fix typo 'and the go' -> 'and then go' 2005-04-01 20:40:17 +00:00
xtraeme
83d6c074cb Bump the number of inodes to 1024 in the MFS case, needed to
create more devices in the ramdisk images, ok'ed by thorpej@.
2005-03-15 23:43:50 +00:00
lukem
4dba64f5d3 Revert previous revert; we don't need RESCUEDIR handling here now
<bsd.prog.mk> has it.
2005-01-13 03:21:59 +00:00
lukem
33349ca906 Revert previous; init(8) still needs special case handling for RESCUEDIR
otherwise the path to mount_mfs(8) and the standard $PATH will be wrong...
2005-01-10 10:59:49 +00:00
dan
603344819a be explicit about the perms of mfs /dev 2004-10-12 10:08:09 +00:00
christos
684fe4faed Remove RESCUEDIR hack; it will be done centrally. 2004-08-19 22:21:51 +00:00
mycroft
e0fc84bd24 Put back one of the sleep()s -- it doesn't affect us in the usual case. 2004-08-13 17:22:39 +00:00
mycroft
f3b5a6849c Replace the sleep(2) in setctty() with a nanosleep(), with a default value of
250ms.
2004-08-13 17:19:15 +00:00
mycroft
40321c3f44 Remove a completely gratuitous 30 delay if you enter the wrong shell path. 2004-08-13 17:11:49 +00:00
christos
e53725b6b7 clear_session_logs is not needed when we are small. 2004-06-06 01:42:20 +00:00
lukem
4b7a7b777e veriexec can't be changed at securelevel 1 2004-02-19 13:24:31 +00:00
wiz
e347fde976 Bump date for previous; new sentence, new line; use more macros; fix a typo. 2003-10-12 07:21:57 +00:00
tls
e333b0fc0e Add an explanation of the fundamental purpose of the "security level"
mechanism and attempt to explain how to use it effectively.
2003-10-12 04:14:56 +00:00
dsl
920dff4b7c If /dev/constty exists, use it instead of /dev/console for single user shell.
I'm not 100% certain it should call login_tty() for anything else.
2003-10-03 13:31:32 +00:00
dsl
58915e2274 If /dev/MAKEDEV is a symlink then preserve the symlink in the mfs /dev.
If /dev/MAKEDEV doesn't exist then try to run /etc/MAKEDEV instead.
Use the (new) '-n inodes' option to mount_mfs and base the size on the number
of inodes and the size of the MAKEDEV script.
2003-09-11 12:51:51 +00:00
agc
276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
dsl
9b8239809b Exit child process if we fail to 'cd /dev' or 'execl sh MAKEDEV'.
Don't really want two processes in the rest of init!
2003-08-05 09:31:48 +00:00
itojun
09401b303a use asprintf, which is easier 2003-07-12 14:46:41 +00:00
christos
9dd592469e Avoid code duplication by factoring out the open/map open/write/unmap functions. 2003-07-01 16:44:48 +00:00
lukem
b96069c077 Always compile in support for attempting to obtain the major device
number of the console from sysctl("machdep.console_device"), rather
than making in optional on the (unused) #ifdef DEBUG.
Certain platforms do not have the console at makedev(0,0) (including
many arm32 and some sh3 platforms), so the "mfs MAKEDEV" hack would
have failed on those.

Noted in private discussion with Quentin Barnes.
2003-07-01 15:24:22 +00:00
lukem
35c2bddeea If RESCUEDIR is defined, use that as an alternate path to sh and mount_mfs,
and prepend RESCUEDIR to the default PATH.
(This replaces my _PATH_ALTSHELL mods from rev 1.52 of init.c)
2003-05-26 09:34:55 +00:00
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