| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove unnecessary includes
- Sort alphabetically
All this has been done using iwyu(1):
......
$ iwyu getaddrinfo_server.c 2>&1 \
| sed -e '\,^#,s, //,/*,' -e '\,^#,s,$, */,' \
| sed '/^#/s/\w*\.\.\./.../';
getaddrinfo_server.c should add these lines:
getaddrinfo_server.c should remove these lines:
- #include <sys/types.h> // lines 1-1
The full include-list for getaddrinfo_server.c:
#include <netdb.h> /* for addrinfo, gai_strerror, freeaddrinfo, ... */
#include <stdio.h> /* for fprintf, NULL, stderr, printf */
#include <stdlib.h> /* for exit, EXIT_FAILURE */
#include <string.h> /* for memset */
#include <sys/socket.h> /* for bind, recvfrom, sendto, socket, ... */
#include <unistd.h> /* for close, ssize_t */
$ iwyu getaddrinfo_client.c 2>&1 \
| sed -e '\,^#,s,//,/*,' -e '\,^#,s,$, */,' \
| sed '/^#/s/\w*\.\.\./.../';
getaddrinfo_client.c should add these lines:
getaddrinfo_client.c should remove these lines:
- #include <sys/types.h> // lines 1-1
The full include-list for getaddrinfo_client.c:
#include <netdb.h> /* for addrinfo, freeaddrinfo, gai_strerror, ... */
#include <stdio.h> /* for fprintf, stderr, perror, printf, NULL, size_t */
#include <stdlib.h> /* for exit, EXIT_FAILURE, EXIT_SUCCESS */
#include <string.h> /* for memset, strlen */
#include <sys/socket.h> /* for connect, socket, AF_UNSPEC, SOCK_DGRAM */
#include <unistd.h> /* for close, read, write, ssize_t */
$
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
This function is insecure. Use getpwuid(3).
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
This is no longer supported by glibc.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
The function doesn't exist anymore.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
Use nftw(3) instead. ftw(3) has issues with [sig]longjmp(3).
Link: <https://stackoverflow.com/q/19617783/6872717>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use snprintf(3) instead. Most Unix systems lack these functions.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As N2417 (a proposal for C2x that was not accepted) suggests.
This syntax is very informative, and also, if used by library
implementers, can improve static analysis.
Since it is backwards compatible with pointer syntax, we can do
this. Also, the reason for not being accepted, as Jens noted,
was incompatibility with C++. But IMO, that's not something that
we should care too much. Users of other languages should know
what to expect when reading C code, and are expected to know C/C++
incompatibilities.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Jens Gustedt <jens.gustedt@loria.fr>
Cc: Glibc <libc-alpha@sourceware.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggest readpassphrase(3bsd) as an alternative.
Some implementations of getpass(3) may suffer from the same issues
that gets(3) suffers and some more. See the long discussion in
the mailing list for more details (link at the bottom of this
commit message). I'll quote some relevant parts here:
Eugene Syromyatnikov <evgsyr@gmail.com>:
{
And the only mention of getpass() in POSIX (at least,
since the 2001's edition) indeed seems to be [1], in the
list of functions that have not been carried forward from
XSH5, the 1997 revision of “System Interfaces and Headers”
(that is, SUSv2)[2], where it is inherited from SUSv1[4]
from XPG[5] and, as Alejandro already mentioned, marked as
obsolete, per XPG3 to XPG4 migration guide[6]; the
previous, 1988, version of POSIX[3] does not mention
getpass() at all.
[1] https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap01.html
[2] https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpass.html
[3] https://mirror.math.princeton.edu/pub/oldlinux/download/c953.pdf
[4] https://pubs.opengroup.org/onlinepubs/9695969499/toc.pdf
[5] https://bitsavers.computerhistory.org/pdf/xOpen/X_Open_Portability_Guide_1985/xpg_2_xopen_system_v_specification_2.pdf
[6] http://archive.opengroup.org/publications/archive/CDROM/g501.pdf
}
Theo de Raadt <deraadt@openbsd.org>:
{
The community finally had the balls to get rid of gets(3).
getpass(3) shares the same flaw, that the buffer size
isn't passed. This has been an issue in the past, and
incorrectly led to readpassphrase(3).
readpassphrase(3) has a few too many features/extensions
for my taste, but at least it is harder to abuse.
}
Alejandro Colomar <alx.manpages@gmail.com>:
{
I found readpassphrase(3) in FreeBSD and OpenBSD. It is
also present in libbsd(7), which is available in most
Linux distributions. I also found it on a Mac that I have
access.
NetBSD has getpass_r(3) instead. It is not in any other
system I have access.
}
Zack Weinberg <zack@owlfolio.org>:
{
I was about to post exactly the same thing. getpass(3)
is not deprecated because there's a better replacement,
it's deprecated because it's _unsafe_. The glibc
implementation wraps getline(3) and therefore doesn't
truncate the passphrase or overflow a fixed-size buffer,
no matter how long the input is, but portable code cannot
rely on that. And come to think of it, using getline(3)
means that prefixes of the passphrase may be left lying
around in malloc's free lists.
(getpass also cannot be made thread safe, due to recycling
of a static buffer, but a program in which multiple
threads are racing to prompt the user for passwords would
be a UX disaster anyway, so I don't think that's a
critical flaw the way it is for e.g. strtok(3).)
The Linux manpage project's documentation is, as I
understand it, for Linux with glibc _first_, but not
_only_; it should not describe this function as
not-deprecated just because glibc has patched its worst
problems and doesn't offer any better API.
}
List: <https://lore.kernel.org/linux-man/6d8642e9-71f7-4a83-9791-880d04f67d17@www.fastmail.com/T/#t>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Git <git@vger.kernel.org>
Cc: Glibc <libc-alpha@sourceware.org>
Cc: OpenBSD <tech@openbsd.org>
Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Cc: Benoit Lecocq <benoit@openbsd.org>
Cc: Klemens Nanni <kn@openbsd.org>
Cc: Randall <rsbecker@nexbridge.com>
Cc: Eugene Syromyatnikov <evgsyr@gmail.com>
Cc: Theo de Raadt <deraadt@openbsd.org>
Cc: Zack Weinberg <zack@owlfolio.org>
Cc: Florian Weimer <libc-alpha@sourceware.org>
|
|
|
|
|
|
| |
They are obsolete in other systems, and broken in glibc.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
They are MT unsafe, and replaced by the MT-safe POSIX regex(3)
functions.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
They are insecure, and replaced by rcmd(3).
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
It cannot be used portably in a localized application.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use scalbn(3) instead.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
*hostent*() are the only ones that are not deprecated, AFAICS.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use memcmp(3) instead.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
They are no longer exposed by glibc.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
See inet_ntop(3).
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
[[deprecated]]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Glibc:
dirent/dirent.h:183:
extern int readdir_r (DIR *__restrict __dirp,
struct dirent *__restrict __entry,
struct dirent **__restrict __result)
__nonnull ((1, 2, 3)) __attribute_deprecated__;
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
sched_yield(3) is identical and is in POSIX.
See glibc commit c2fd60a5861efef48252f5cc7efc70e1d8a0da9a.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
These functions are not anymore in glibc. All other systems
call them deprecated.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
These functions are misleading, and in some systems mean a
different thing (tgamma(3) vs lgamma(3)). Never use gamma(3).
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
| |
memmove(3) completely replaces bcopy(3), being an almost identical
function, except for the different order in the arguments.
memmove(3) is part of ISO C and POSIX.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use proc(5) instead.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
| |
[[deprecated]]
The BSD version of getpgrp(2) was superseeded by the POSIX one.
The BSD version of setpgrp(2) was superseeded by the POSIX one.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use utimensat(2) instead.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use sigprocmask(2) instead.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
tkill(2) has been superseeded by tgkill(2).
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
This syscall no longer exists!
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Glibc 2.28 removed the wrapper for this syscall.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
This syscall was removed from glibc 2.31 for newly linked
programs.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
LSB deprecated these syscalls in favor of [f]statvfs(3).
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
This syscall was marked as deprecated in Linux 3.16.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
This syscall was removed in Linux 2.6.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
ioperm(2) is recommended instead.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
This syscall was removed in Linux 2.6.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|