It starts as a NULL pointer, then might get set as a pointer to optarg,
then it might get set to point to an argv parameter, then it might have
a string value copied into it, over-writing the original data. We should
not risk over-writing internal variables which might get used for something
else (it's rude and security risk). Set up "when" as its own buffer
that has data from optargs and/or argv copied into it.
Minor code fixes across multiple source files to avoid buffer
overflows, or uninitialized strings.
the command now passes the "-h -P" flags to shutdown. This
in turn sets the INIT_HALT environment variable to POWEROFF.
Assuming this value is checked by initscripts during the
shutting down procedure, it should cause the system to
be powered off.
If halt is called without -p then the value of INIT_HALT
is not set and the default action (often set in /etc/defaut/halt)
is taken.
Closes Debian bugs #815839, #905245 and #890478
Added -f <format> option to pidof program to allow printf
style formating.
Closes Debian bug #571590
Thanks to Philipp Marek for the patch.
as LILO is rarely used outside of the Slackware family these days.
Switched stty flags to use ECHOE instead of ECHOPRT. This should
give smoother, more natural backspac-erase behaviour on emergency
consoles. (Created in init -b mode.)
message appear less often. The -q flag causes messages to only appear at the
10 minute, 5 minute and x-hour intervals.
The -Q flag maintains complete silence up until the final "now" warning.
init will try to open its own console. If not, then any console=
parameters will be ignored. This avoids conflicts with native kernel
created consoles.
This information can be read by the "runlevel" command as well as "halt"
and "reboot". Having the information logged in /var/run/runlevel as
well as the utmp file means systems without utmp (like those running
the musl C library) can still check the current runlevel. This is
useful when running halt/reboot as these programs want to check the
runlevel.
Updated the changelog, and manual pages for halt and runlevel.
approaches are tried in order to prevent warnings from GCC 7 (and newer).
Added includes on Linux for sys/sysmacros.h as the old defines in
the sys/types.h file will be removed in the future.
it closes (and leaves closed) the named pipe /run/initctl. This
can be used to make sure init does not have any files open. However,
it also means we cannot switch run levels or bring down the system.
The pipe can be re-opened by sending init the SIGUSR1 signal.
Updated the man pages for initctl and init to include this information.
notice. For example if the computer was in sleep mode pending
a shutdown. The shutdown command now notices time has past
and adjusts its countdown clock to compensate. Accurate
to the nearest minute.
Closes Savannah bug #36279
Fixed typo in accidental wrote_wtmp_rlevel == 0 || wrote_wtmp_rlevel
comparison so the latter is wrote_utmp_rlevel.
Simplified logic in mountpoint.c when testing for same device or same inode.
Thanks to David Binderman for pointing out the above three issues.