History log of /openbsd/sbin/init/init.c (Results 1 – 25 of 72)
Revision Date Author Comments
# bdce9d03 10-Sep-2022 cheloha <cheloha@openbsd.org>

init(8): fix signal handler boolean type and qualifier

The variable "clang" is modified from a signal handler. Change it
from an 'int' to a 'sig_atomic_t' and mark it 'volatile', as we
recommend in

init(8): fix signal handler boolean type and qualifier

The variable "clang" is modified from a signal handler. Change it
from an 'int' to a 'sig_atomic_t' and mark it 'volatile', as we
recommend in signal(3).

ok millert@ kn@

show more ...


# b7041c07 24-Oct-2021 deraadt <deraadt@openbsd.org>

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which mig

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert

show more ...


# b1fde1a1 25-Mar-2020 cheloha <cheloha@openbsd.org>

init(8): use err(3) instead of hand-rolled fprintf(3) messages


# df69c215 28-Jun-2019 deraadt <deraadt@openbsd.org>

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if

When system calls indicate an error they return -1, not some arbitrary
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.

show more ...


# 9a190421 24-Aug-2018 cheloha <cheloha@openbsd.org>

Drop special handling of SIGSYS.

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

Drop special handling of SIGSYS.

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@

show more ...


# eb10f49c 31-Jan-2018 cheloha <cheloha@openbsd.org>

Check GETTY_SPACING against the monotonic clock.

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

Check GETTY_SPACING against the monotonic clock.

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@

show more ...


# bd61d3e8 06-Jan-2018 millert <millert@openbsd.org>

unifdef LOGIN_CAP, we always want to use login.conf
OK jca@, no objection deraadt@


# 02638669 16-Jun-2017 natano <natano@openbsd.org>

s/CPU_LIDSUSPEND/CPU_LIDACTION/
ok mlarkin


# 3a7efd93 03-May-2017 mestre <mestre@openbsd.org>

Use the safe idiom of cleaning sensitive data from memory with explicit_bzero,
instead of relying on other methods, after readpassphrase. Some programs on
this diff won't benefit that much since it h

Use the safe idiom of cleaning sensitive data from memory with explicit_bzero,
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@

show more ...


# 2d357aed 02-Mar-2017 natano <natano@openbsd.org>

Add a new sysctl machdep.lidaction. The sysctl works as follows:

machdep.lidaction=0 # do nothing
machdep.lidaction=1 # suspend
machdep.lidaction=2 # hibernate

lidsuspend is just an alias for lidac

Add a new sysctl machdep.lidaction. The sysctl works as follows:

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

show more ...


# c43387b9 05-Sep-2016 gsoares <gsoares@openbsd.org>

replace obsolete getpass() by readpassphrase()
OK tedu millert


# ce842bbc 04-Sep-2016 nicm <nicm@openbsd.org>

Use an RB tree instead of BDB to map process->session, ok tedu millert


# ae0936cc 27-Aug-2016 guenther <guenther@openbsd.org>

Pull in <sys/time.h> for struct timespec

ok deraadt@


# 178d191e 10-May-2016 bluhm <bluhm@openbsd.org>

Do not close the stdio file desciptors in init(8), but dup2(2) them
from /dev/null. The code is taken from daemon(3). Also move this
operation to the beginning.
OK millert@ deraadt@


# 9044f8b1 01-Feb-2016 jca <jca@openbsd.org>

Remove variable unneeded since introduction of crypt_checkpass

ok millert@


# f52a7f8c 23-Dec-2015 mmcc <mmcc@openbsd.org>

Use NULL rather than 0 for pointers. No binary change.


# 5ce950de 10-Dec-2015 mmcc <mmcc@openbsd.org>

Remove NULL-checks before free(). ok tb@


# fc334d60 18-Nov-2015 tedu <tedu@openbsd.org>

use _shadow getpwnam (and crypt_checkpass)


# 5ae94ef8 20-Aug-2015 deraadt <deraadt@openbsd.org>

<stdlib.h> is included, so do not need to cast result from
malloc, calloc, realloc*
ok krw millert


# 5085bfb6 14-Jul-2015 millert <millert@openbsd.org>

Use volatile sig_atomic_t for requested_transition since it is
modified inside signal handlers. Instead of returning a function
pointer, the state functions now return an enum for the next state.
Th

Use volatile sig_atomic_t for requested_transition since it is
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@

show more ...


# b9fc9a72 16-Jan-2015 deraadt <deraadt@openbsd.org>

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_N

Replace <sys/param.h> with <limits.h> and other less dirty headers where
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)

show more ...


# 29f576e8 06-Dec-2014 bluhm <bluhm@openbsd.org>

Do not define the variable pid twice to avoid a compiler warning.
OK millert@


# e7049ca9 22-Apr-2014 tedu <tedu@openbsd.org>

malloc/memset->calloc. with bonus null check. from peter malone.


# ec7f310b 03-Jan-2014 millert <millert@openbsd.org>

Do not raise the securelevel when transitioning from catatonia to
multiuser since we are not actually going multiuser. Fixes a problem
where the securelevel was raised for rc.shutdown even when rebo

Do not raise the securelevel when transitioning from catatonia to
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@

show more ...


# ca371601 11-Feb-2013 millert <millert@openbsd.org>

Ignore sysctl failure for CPU_LIDSUSPEND when errno is EOPNOTSUPP.
Just because CPU_LIDSUSPEND is defined in cpu.h does mean it is
actually supported by the hardware. OK halex@


123