Commit Graph

10 Commits

Author SHA1 Message Date
Jesse Smith
483dc777d2 Changed the way the "when" variable is used internally in shutdown.c.
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.
2019-01-27 15:55:08 -04:00
Jesse Smith
5dc965ba10 Removed references to malloc.h Allocating and freeing memory
is now handled by stdlib.h
2018-12-09 17:55:52 -04:00
Jesse Smith
44fce86dde Added -l flag to "last" command. When used it allows "last" to
display usernames longer than 8 characters long.
2018-10-30 21:46:04 -03:00
Petter Reinholdtsen
5421d713ae Adjust more included headers to be compatible with the musl C
library.  Patch from Matias A. Fonzo and Dragora.
2014-01-28 22:07:30 +00:00
Petter Reinholdtsen
7d6e3683b0 Make sure logintime string can never overflow (Coverity CID 1164485). 2014-01-26 13:38:51 +00:00
Werner Fink
84e86ebbcd * Fix signal and alarm handling based on the patch from Florent Viard.
(was local bug #32304)
* Add fix for Redhat bug #573346: last incorrectly displays IPv6
  addresses (was local bug #29497)
2011-03-11 16:10:42 +00:00
Werner Fink
1874af5c9c * Add option -w to the last command to display the full user and
domain names in the output.  Patch from Petr Lautrbach.
  * Add a manual page for utmpdump as this tool is sometimes
    very useful even if not intended for normal use.
  * Use paths.h macros for wall
  * Change path "/etc/powerstatus" to "/var/run/powerstatus"
2010-02-19 15:51:36 +00:00
Werner Fink
13de2e9e05 Add the comment from Andrea Arcangeli about the correct
place of setting the default childhandler within spawn().
Make sure that newline is printed out for last(1) even
if an utmp record entry is truncated.
Check if utmp not only exists but is writable and delay
writing out of the utmp runlevel record if utmp is not writable.
Be able to find libcrypt also on 64 bit based architectures.
2009-11-24 10:03:19 +00:00
Petter Reinholdtsen
6d894fd45b Add casts to get rid of compiler warning about signed/unsigned issues. 2009-11-14 21:27:13 +00:00
Petter Reinholdtsen
2fe47a3c9f Drop hurd specific dependency on libc0.3 (>= 2.3.2.ds1-12). It is
no longer needed according to Michael Bunk.  Patch from Michael
Biebl.
2009-09-10 08:28:49 +00:00