strftime(3) makes no guarantees about the contents of the buffer if the formatted string wouldn't fit in the buffer. It simply returns 0, and it's the programmer's responsibility to do the right thing after that. Let's write the string "future" if there's an error, similar to what we do with gmtime(3)'s errors. Also, `buf[size - 1] = '\0';` didn't make sense. If the copy fits, strftime(3) guarantees to terminate with NUL. If it doesn't, the entire contents of buf are undefined, so adding a NUL at the end of the buffer would be dangerous: the string could contain anything, such as "gimme root access now". Remove that, now that we set the string to "future", as with gmtime(3) errors. This setting to '\0' comes from the times when we used strncpy(3) in the implementation, and should have been removed when I changed it to use strlcpy(3); however, I didn't check we didn't need it anymore. Cc: Serge Hallyn <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
shadow-utils
Introduction
The shadow-utils package includes the necessary programs for converting UNIX password files to the shadow password format, plus programs for managing user and group accounts. The pwconv command converts passwords to the shadow password format. The pwunconv command unconverts shadow passwords and generates a passwd file (a standard UNIX password file). The pwck command checks the integrity of password and shadow files. The lastlog command prints out the last login times for all users. The useradd, userdel, and usermod commands are used for managing user accounts. The groupadd, groupdel, and groupmod commands are used for managing group accounts.
Sites
Code
The main development branch is at https://github.com/shadow-maint/shadow.git
See STABLE.md for a list of supported stable branches.
Contacts
There are several ways to contact us:
- the general discussion mailing list
- the #shadow IRC channel on libera.chat:
- irc://irc.libera.chat/shadow
Mailing archives
- the general discussion mailing list archive
- the commit mailing list archive, only used for historical purposes
Contributions
Contributions are welcome. Follow the guidelines before posting any patches.
Authors and maintainers
Authors and maintainers are listed in AUTHORS.md.