Go to file
Alejandro Colomar e7a292ed4f Use bzero(3) instead of its pattern
It was blessed by POSIX.1-2001, and GCC says that it won't go away,
possibly ever.

memset(3) is dangerous, as the 2nd and 3rd arguments can be accidentally
swapped --who remembers what's the order of the 2nd and 3rd parameters
to memset(3) without checking the manual page or some code that uses
it?--.  Some recent compilers may be able to catch that via some
warnings, but those are not infalible.  And even if compiler warnings
could always catch that, the time lost in fixing or checking the docs is
lost for no clear gain.  Having a sane API that is unambiguous is the
Right Thing (tm); and that API is bzero(3).

If someone doesn't believe memset(3) is error-prone, please read the
book "Unix Network Programming", Volume 1, 3rd Edition by Stevens, et
al., Section 1.2.  See a stackoverflow reference in the link below[1].

bzero(3) had a bad fame in the bad old days, because some ancient
systems (I'm talking of many decades ago) shipped a broken version of
bzero(3).  We can assume that all systems in which current shadow utils
can be built, have a working version of bzero(3) --if not, please fix
your broken system; don't blame the programmer--.

One reason that some use today to avoid bzero(3) in favor of memset(3)
is that memset(3) is more often used; but that's a circular reasoning.
Even if bzero(3) wasn't supported by the system, it would need to be
invented.  It's the right API.

Another reason that some argue is that POSIX.1-2008 removed the
specification of bzero(3).  That's not a problem, because GCC will
probably support it forever, and even if it didn't, we can redefine it
like we do with memzero().  bzero(3) is just a one-liner wrapper around
memset(3).

Link: [1] <https://stackoverflow.com/a/17097978>
Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-09-01 09:39:23 +02:00
.builds CI: add libbsd and pkg-config dependencies 2022-11-28 09:07:41 -06:00
.github Add a make dist CI test 2023-08-04 14:15:49 -05:00
contrib Remove superfluous casts 2023-02-09 10:03:03 -06:00
doc doc: mention ci workflow file to learn about deps 2023-07-27 10:03:28 -05:00
etc Releases: add etc/shadow-maint to distfiles 2023-08-12 23:16:56 -05:00
lib Use bzero(3) instead of its pattern 2023-09-01 09:39:23 +02:00
libsubid lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00
man man: include shadow-man.xsl in tarball 2023-08-09 21:33:21 -05:00
po lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00
share CI: compile old utmp interface in Fedora 2023-08-02 10:13:28 -05:00
src Use bzero(3) instead of its pattern 2023-09-01 09:39:23 +02:00
tests lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00
.editorconfig Add .editorconfig 2023-03-02 16:33:06 -06:00
.gitignore lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00
.travis.yml CI: Make build logs more readable 2023-04-18 09:21:09 +02:00
acinclude.m4 configure: replace obsolete autoconf macros 2022-05-10 09:55:18 +02:00
AUTHORS.md Update AUTHORS to add Marek Michałkiewicz 2023-04-24 09:01:22 +02:00
autogen.sh autogen: enable lastlog build 2023-08-07 09:42:11 -05:00
ChangeLog fix typos 2023-04-26 17:35:58 -05:00
configure.ac lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00
COPYING Update licensing info 2021-12-23 19:36:50 -06:00
Makefile.am lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00
NEWS fix typos 2023-04-26 17:35:58 -05:00
README Add README as symlink to README.md 2021-12-19 14:09:08 -06:00
README.md README: add reference to contribution guidelines 2023-04-03 10:42:22 -05:00
SECURITY.md SECURITY.md: add Iker Pedrosa 2023-03-20 10:54:45 -05:00
shadow.spec.in * shadow.spec.in: Fix the source (new FTP). 2008-08-31 17:30:45 +00:00
TODO lib: Merge libmisc into libshadow 2023-08-31 08:55:26 +02:00

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

Contacts

There are several ways to contact us:

Mailing archives

Contributions

Contributions are welcome. Follow the guidelines before posting any patches.

Authors and maintainers

Authors and maintainers are listed in AUTHORS.md.