eec5f9fccc
gethostbyname(3) was removed in POSIX.1-2008. It has been obsoleted, and replaced by getaddrinfo(3), which is superior in several ways: - gethostbyname(3) is not reentrant. There's a GNU extension, gethostbyname_r(3) which is reentrant, but it's not likely to be standardized for the following reason. And we don't care too much about this point either. - gethostbyname(3) only supports IPv4, but getaddrinfo(3) supports both IPv4 and IPv6 (and may support other address families in the future). We don't care about reentrancy, so for keeping the code simple (i.e., not touch call site to add code to free(3) an allocated buffer), I added a static buffer for inet_ntop(3). We could address that in the future, but I don't think it's worth it. BTW, we also replace inet_ntoa(3) by inet_ntop(3), as a consequence of using getaddrinfo(3). inet_ntoa(3) is also marked as deprecated, but that deprecation seems to have been documented only in the manual page, and POSIX doesn't mark it as deprecated. The deprecation notice goes back to when the inet_ntop(3) manual page was added by Sam Varshavchik to the Linux man-pages in version 1.30 (year 2000). So, this, apart from updating the code to POSIX.1-2008, is also adding support for IPv6 :) Although, probably many other parts of the code are written for IPv4 only, so I wouldn't yet claim support for it. A few notes: - I didn't check the return value of inet_ntop(3), since it can't fail for the given input: - EAFNOSUPPORT: We only call it with AF_INET and AF_INET6. - ENOSPC: We calculate the size of the buffer to be wide enough: MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) so it always fits. Cc: Dave Hagewood <admin@arrowweb.com> Cc: Sam Varshavchik Cc: Jakub Jelinek <jakub@redhat.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org> |
||
---|---|---|
.builds | ||
.github | ||
contrib | ||
doc | ||
docs | ||
etc | ||
lib | ||
libmisc | ||
libsubid | ||
man | ||
po | ||
src | ||
tests | ||
.gitignore | ||
.travis.yml | ||
acinclude.m4 | ||
AUTHORS.md | ||
autogen.sh | ||
ChangeLog | ||
configure.ac | ||
COPYING | ||
Makefile.am | ||
NEWS | ||
README | ||
README.md | ||
SECURITY.md | ||
shadow.spec.in | ||
TODO |
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:
- 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
Authors and maintainers
Authors and maintainers are listed in AUTHORS.md.