summaryrefslogtreecommitdiffstats
path: root/sbin/init
AgeCommit message (Collapse)AuthorFilesLines
2020-03-25init(8): use err(3) instead of hand-rolled fprintf(3) messagescheloha1-9/+5
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt1-4/+4
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2018-08-24Drop special handling of SIGSYS.cheloha1-20/+2
Tolerance for up to 25 SIGSYS deliveries was added to init(8) soon after the addition of sysctl(2) at CSRG, presumably to ease the transition to the new ABI. After 25 years of work the ABI transition is finally complete and we can now safely remove this splint. In general, we now have better practices and methods for helping userspace across kernel ABI breaks. ok deraadt@
2018-01-31Check GETTY_SPACING against the monotonic clock.cheloha1-10/+14
Ensures that we can use the check if the system clock is set backwards. While here, move time retrieval into the child process in start_getty(), and only get the time if se_started has been set. ok millert@ tb@
2018-01-16GETTY_SLEEP is 30 seconds, not 10cheloha1-3/+3
ok deraadt@
2018-01-06unifdef LOGIN_CAP, we always want to use login.confmillert2-15/+5
OK jca@, no objection deraadt@
2017-06-16s/CPU_LIDSUSPEND/CPU_LIDACTION/natano1-2/+2
ok mlarkin
2017-05-03Use the safe idiom of cleaning sensitive data from memory with explicit_bzero,mestre1-3/+4
instead of relying on other methods, after readpassphrase. Some programs on this diff won't benefit that much since it happens near the terminal path, but someone might copy the unsafe idiom to another program and place it where it may leak sensitive data. Discussed aeons ago with tb@, OK deraadt@ and beck@
2017-03-02Add a new sysctl machdep.lidaction. The sysctl works as follows:natano1-6/+6
machdep.lidaction=0 # do nothing machdep.lidaction=1 # suspend machdep.lidaction=2 # hibernate lidsuspend is just an alias for lidaction, so if you change one, the other one will have the same value. The plan is to remove machdep.lidsuspend eventually when people have upgraded their /ets/sysctl.conf. discussed with deraadt, who came up with the new MIB name no objections mlarkin ok stsp halex jcs
2016-10-06fix HISTORY;schwarze1-3/+3
patches from Sevan Janiyan <venture37 at geeklan dot co dot uk>; verified using minnie.tuhs.org/cgi-bin/utree.pl
2016-09-05for consistency, hyphenate "single-user";jmc1-4/+4
from rob pierce
2016-09-05replace obsolete getpass() by readpassphrase()gsoares1-2/+4
OK tedu millert
2016-09-04Use an RB tree instead of BDB to map process->session, ok tedu millertnicm1-41/+20
2016-08-27Pull in <sys/time.h> for struct timespecguenther1-2/+3
ok deraadt@
2016-05-10Do not close the stdio file desciptors in init(8), but dup2(2) thembluhm1-9/+13
from /dev/null. The code is taken from daemon(3). Also move this operation to the beginning. OK millert@ deraadt@
2016-02-01Remove variable unneeded since introduction of crypt_checkpassjca1-2/+2
ok millert@
2015-12-23Use NULL rather than 0 for pointers. No binary change.mmcc1-9/+9
2015-12-10Remove NULL-checks before free(). ok tb@mmcc1-3/+2
2015-11-18use _shadow getpwnam (and crypt_checkpass)tedu1-6/+8
2015-09-25there's no need to keep init secret these days, and the (unused)tedu1-3/+1
immutable flags would just be a pita. remove custom bin mode.
2015-08-20<stdlib.h> is included, so do not need to cast result fromderaadt1-3/+2
malloc, calloc, realloc* ok krw millert
2015-07-14Use volatile sig_atomic_t for requested_transition since it ismillert1-61/+82
modified inside signal handlers. Instead of returning a function pointer, the state functions now return an enum for the next state. This is used as an index into an array of function pointers to do the actual state change in transition(). OK deraadt@
2015-03-18Make init(8) static PIE.pascal1-3/+1
ok deraadt@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt1-4/+4
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-12-06Do not define the variable pid twice to avoid a compiler warning.bluhm1-2/+1
OK millert@
2014-04-22malloc/memset->calloc. with bonus null check. from peter malone.tedu1-3/+4
2014-01-03Do not raise the securelevel when transitioning from catatonia tomillert1-5/+7
multiuser since we are not actually going multiuser. Fixes a problem where the securelevel was raised for rc.shutdown even when reboot was run from single user mode. OK deraadt@
2013-02-11Ignore sysctl failure for CPU_LIDSUSPEND when errno is EOPNOTSUPP.millert1-2/+2
Just because CPU_LIDSUSPEND is defined in cpu.h does mean it is actually supported by the hardware. OK halex@
2012-10-11fix "disable lidsuspend on shutdown":halex1-3/+3
- pull in machine/cpu.h so we can actually see CPU_LIDSUSPEND if it's there - fix the resulting compilation errors now that the code is actually used "Just go for it" deraadt@
2012-04-06no need to (unsigned) a small constantderaadt1-2/+2
2011-09-04knock out useless Pp;jmc1-3/+2
2011-05-10Some cleanup and simplifications:schwarze1-24/+32
- Explain single user mode once, not three times. - Do not claim that the boot program talked to init; it cannot do so. - Mention that the OpenBSD kernel does not support init -f. - And some minor rewordings and reorderings. Feedback and ok jmc@.
2010-10-15tweak previous;jmc1-3/+3
2010-10-15freebsd uses SIGINT to request a reboot, we may as well be consistent.dlg2-8/+8
pointed out by kettenis@ and deraadt@
2010-10-14add a SIGQUIT handler that does the same as USR1 and USR2, except itdlg2-16/+37
reboots the machine instead just halting or powering down. diff from Jonathan Matthew manpage tweaks from jmc@ ok deraadt@
2010-09-29Add missing err.h includedcoppa1-1/+2
OK deraadt@
2010-09-19more wacky macro fixing;jmc1-3/+3
2010-08-07disable lidsuspend when we are powering downphessler1-1/+12
"I like this" marco@, "Sure" deraadt@
2010-03-14.Pd -> .Pqjmc1-3/+3
2009-10-27rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt1-15/+1
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2007-09-03malloc(n * m) -> calloc(n, m); ok espiederaadt1-3/+3
2007-05-31convert to new .Dd format;jmc1-2/+2
2007-01-29sort FILES;jmc1-7/+7
2007-01-29add /fastboot to FILES, since these pages discuss that file;jmc1-1/+7
2006-07-25correct .Xr; from marcus poppjmc1-2/+2
2006-06-22let's just use "getty" as the plural of `getty', because "getty's" isjmc1-3/+3
very painful, and "gettys" is misleading;
2006-06-22accept SIGUSR2. Like SIGUSR1, except it makes RB_POWERDOWN mandatory.deraadt2-8/+33
This will be used by kernel components which are trying to really really power the system down. suggested and tested by jason
2006-03-19Fix mem leaks in error path. From NetBSD's coverity analysis. ok pat@otto1-3/+8
deraadt@
2005-12-10better wording, helped by krw and roughly ok deraadt;jmc1-3/+3
2005-11-12use snprintf; dhill@mindcry.orgderaadt1-11/+6