summaryrefslogtreecommitdiffstats
path: root/sbin/init (follow)
Commit message (Collapse)AuthorAgeFilesLines
* init(8): use err(3) instead of hand-rolled fprintf(3) messagescheloha2020-03-251-9/+5
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-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.
* Drop special handling of SIGSYS.cheloha2018-08-241-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@
* Check GETTY_SPACING against the monotonic clock.cheloha2018-01-311-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@
* GETTY_SLEEP is 30 seconds, not 10cheloha2018-01-161-3/+3
| | | | ok deraadt@
* unifdef LOGIN_CAP, we always want to use login.confmillert2018-01-062-15/+5
| | | | OK jca@, no objection deraadt@
* s/CPU_LIDSUSPEND/CPU_LIDACTION/natano2017-06-161-2/+2
| | | | ok mlarkin
* Use the safe idiom of cleaning sensitive data from memory with explicit_bzero,mestre2017-05-031-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@
* Add a new sysctl machdep.lidaction. The sysctl works as follows:natano2017-03-021-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
* fix HISTORY;schwarze2016-10-061-3/+3
| | | | | patches from Sevan Janiyan <venture37 at geeklan dot co dot uk>; verified using minnie.tuhs.org/cgi-bin/utree.pl
* for consistency, hyphenate "single-user";jmc2016-09-051-4/+4
| | | | from rob pierce
* replace obsolete getpass() by readpassphrase()gsoares2016-09-051-2/+4
| | | | OK tedu millert
* Use an RB tree instead of BDB to map process->session, ok tedu millertnicm2016-09-041-41/+20
|
* Pull in <sys/time.h> for struct timespecguenther2016-08-271-2/+3
| | | | ok deraadt@
* Do not close the stdio file desciptors in init(8), but dup2(2) thembluhm2016-05-101-9/+13
| | | | | | from /dev/null. The code is taken from daemon(3). Also move this operation to the beginning. OK millert@ deraadt@
* Remove variable unneeded since introduction of crypt_checkpassjca2016-02-011-2/+2
| | | | ok millert@
* Use NULL rather than 0 for pointers. No binary change.mmcc2015-12-231-9/+9
|
* Remove NULL-checks before free(). ok tb@mmcc2015-12-101-3/+2
|
* use _shadow getpwnam (and crypt_checkpass)tedu2015-11-181-6/+8
|
* there's no need to keep init secret these days, and the (unused)tedu2015-09-251-3/+1
| | | | immutable flags would just be a pita. remove custom bin mode.
* <stdlib.h> is included, so do not need to cast result fromderaadt2015-08-201-3/+2
| | | | | malloc, calloc, realloc* ok krw millert
* Use volatile sig_atomic_t for requested_transition since it ismillert2015-07-141-62/+83
| | | | | | | 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@
* Make init(8) static PIE.pascal2015-03-181-3/+1
| | | | ok deraadt@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-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)
* Do not define the variable pid twice to avoid a compiler warning.bluhm2014-12-061-2/+1
| | | | OK millert@
* malloc/memset->calloc. with bonus null check. from peter malone.tedu2014-04-221-3/+4
|
* Do not raise the securelevel when transitioning from catatonia tomillert2014-01-031-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@
* Ignore sysctl failure for CPU_LIDSUSPEND when errno is EOPNOTSUPP.millert2013-02-111-2/+2
| | | | | Just because CPU_LIDSUSPEND is defined in cpu.h does mean it is actually supported by the hardware. OK halex@
* fix "disable lidsuspend on shutdown":halex2012-10-111-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@
* no need to (unsigned) a small constantderaadt2012-04-061-2/+2
|
* knock out useless Pp;jmc2011-09-041-3/+2
|
* Some cleanup and simplifications:schwarze2011-05-101-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@.
* tweak previous;jmc2010-10-151-3/+3
|
* freebsd uses SIGINT to request a reboot, we may as well be consistent.dlg2010-10-152-8/+8
| | | | pointed out by kettenis@ and deraadt@
* add a SIGQUIT handler that does the same as USR1 and USR2, except itdlg2010-10-142-16/+37
| | | | | | | | reboots the machine instead just halting or powering down. diff from Jonathan Matthew manpage tweaks from jmc@ ok deraadt@
* Add missing err.h includedcoppa2010-09-291-1/+2
| | | | OK deraadt@
* more wacky macro fixing;jmc2010-09-191-3/+3
|
* disable lidsuspend when we are powering downphessler2010-08-071-1/+12
| | | | "I like this" marco@, "Sure" deraadt@
* .Pd -> .Pqjmc2010-03-141-3/+3
|
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-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
* malloc(n * m) -> calloc(n, m); ok espiederaadt2007-09-031-3/+3
|
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* sort FILES;jmc2007-01-291-7/+7
|
* add /fastboot to FILES, since these pages discuss that file;jmc2007-01-291-1/+7
|
* correct .Xr; from marcus poppjmc2006-07-251-2/+2
|
* let's just use "getty" as the plural of `getty', because "getty's" isjmc2006-06-221-3/+3
| | | | very painful, and "gettys" is misleading;
* accept SIGUSR2. Like SIGUSR1, except it makes RB_POWERDOWN mandatory.deraadt2006-06-222-8/+33
| | | | | This will be used by kernel components which are trying to really really power the system down. suggested and tested by jason
* Fix mem leaks in error path. From NetBSD's coverity analysis. ok pat@otto2006-03-191-3/+8
| | | | deraadt@
* better wording, helped by krw and roughly ok deraadt;jmc2005-12-101-3/+3
|
* use snprintf; dhill@mindcry.orgderaadt2005-11-121-11/+6
|