282 Commits

Author SHA1 Message Date
Simon Josefsson
8e9d7c933a doc: Fix codespell nits 2025-11-27 00:33:35 +01:00
Collin Funk
8e88c32cfe maint: Fix link errors on Solaris 11 OmniOS.
* bootstrap.conf (gnulib_modules): Add hostent and socket.
* ftp/Makefile.am (ftp_LDADD): New variable.
* ftpd/Makefile.am (ftpd_LDADD): New variable.
* ifconfig/Makefile.am (ifconfig_LDADD): New variable.
* ping/Makefile.am (ping_LDADD): Add $(LIBSOCKET), $(HOSTENT_LIB),
$(LIBINTL), and $(GETADDRINFO_LIB).
(ping6_LDADD): New variable.
* src/Makefile.am (hostname_LDADD, rlogin_LDADD, rsh_LDADD): Add
$(HOSTENT_LIB).
(tftp_LDADD, rexecd_LDADD): Add $(LIBSOCKET).
(rexec_LDADD, dnsdomainname_LDADD, logger_LDADD, inetd_LDADD)
(tftpd_LDADD): New variables.
(rlogind_LDADD): Add $(LIBSOCKET), $(LIBINTL), and $(GETADDRINFO_LIB).
(rshd_LDADD): Add $(HOSTENT_LIB), $(LIBINTL), and $(GETADDRINFO_LIB).
(syslogd_LDADD): Add $(LIBSOCKET), $(HOSTENT_LIB), $(LIBINTL), and
$(GETADDRINFO_LIB).
(uucpd_LDADD): Add $(LIBSOCKET) and $(HOSTENT_LIB).
* talk/Makefile.am (talk_LDADD): New variable.
* talkd/Makefile.am (talkd_LDADD): New variable.
* telnet/Makefile.am (telnet_LDADD): New variable.
* telnetd/Makefile.am (telnetd_LDADD): New variable.
* tests/Makefile.am (localhost_LDADD, runtime_ipv6_LDADD)
(addrpeek_LDADD, tcpget_LDADD): New variables.
* whois/Makefile.am (whois_LDADD): New variable.
2025-02-25 22:36:20 -08:00
Simon Josefsson
04c3738a6c maint: Run 'make update-copyright'. 2025-01-01 18:21:25 +01:00
Collin Funk
e29e76b37b ftp: Cleanup port number to string conversion.
* bootstrap.conf (gnulib_modules): Add intprops.
* ftp/ftp.c: Include intprops.h.
(portstr): Size buffer to fit exactly 'in_port_t' and a NUL byte.
(hookup): Use 'in_port_t' to represent the port instead of int. Use
sprintf since the buffer size is safe.
* ftp/extern.h (hookup): Adjust deceleration.
* ftp/ftp_var.h: Include netinet/in.h for type definitions.
2024-08-02 22:58:56 -07:00
Collin Funk
572af87d9e ftp: Modernize time functions.
* ftp/Makefile.am (LDADD): Add $(CLOCK_TIME_LIB).
* ftp/extern.h (struct timespec): Add a forward declaration.
(ptransfer): Use timespec instead of timeval.
(tvsub): Remove declaration.
* ftp/ftp.c: Include <float.h> and <timespec.h>
(sendrequest): Use current_timespec instead of gettimeofday.
(recvrequest): Likewise.
(ptransfer): Use timespec_sub instead of tvsub. Divide by FLT_MIN
instead of 1 if seconds is zero.
(tvsub): Remove function.
2024-06-27 23:10:12 -07:00
Collin Funk
e5a9384c92 maint: Remove unnecessary standard library extern function decls.
* ftp/cmds.c (account, user): Don't declare getpass since it is
defined in unistd.h.
* ftp/ftp.c (login): Likewise. Don't declare fclose and pclose since
they are defined in stdio.h.
* ftpd/extern.h: Don't declare getusershell since it is defined in
unistd.h.
* ftpd/ftpd.c: Don't declare fclose since it is defined in stdio.h.
* libinetutils/logwtmp.c: Don't declare errno since it is defined in
errno.h.
* libtelnet/misc.c (auth_encrypt_user): Include string.h and don't
declare strdup.
* telnet/authenc.c (telnet_gets):  Don't declare getpass since it is
defined in unistd.h.
* telnet/commands.c (hostname): Use NULL instead of 0.
(env_init, shell): Include string.h and don't redeclare functions.
2024-05-08 20:29:36 -07:00
Collin Funk
4d71ebcc50 Fix sc_bsd_caddr checks.
* libinetutils/if_index.c (if_nameindex): Don't cast non-void pointer
arithmetic.
* ftp/ftp.c (hookup): Don't cast pointers to memmove and memset.
* src/inetd.c (getconfigent): Likewise.
* telnet/commands.c (tn): Likewise.
2024-05-06 14:50:17 -07:00
Simon Josefsson
aba8d6528e maint: Run 'make update-copyright'. 2024-01-01 11:28:59 +01:00
Simon Josefsson
2cf199580a maint: Re-indent using GNU indent 2.2.13. 2023-12-29 18:35:01 +01:00
Simon Josefsson
4bfe18d36f maint: Run 'make update-copyright'. 2023-01-01 01:37:41 +01:00
Simon Josefsson
c1b8d134d5 Indent code. 2022-10-26 00:03:45 +02:00
Simon Josefsson
ae98f5b651 Don't use variable names true/bool, fixing gnulib builds and syncs with BSD.
* src/rlogind.c (rlogind_mainloop): Replace 'true' with 'on'.
* telnetd/telnetd.c (telnetd_setup): Likewise.
* ftp/cmds.c (onoff): Replace 'bool' with 'val'.
2022-10-14 21:40:19 +02:00
Erik Auerswald
6df3400bc4 ftp: Avoid crash via infinite macro recursion
This fixes the problem reported by AiDai in
<https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00005.html>.

* NEWS: Mention fix.
* doc/inetutils.texi (Ftp commands):  Mention macro nesting depth
limit.
* ftp/domacro.c:  New constant MAX_MACRO_NESTING_DEPTH.
(domacro):  Limit macro nesting depth to MAX_MACRO_NESTING_DEPTH.
* tests/ftp-parser.sh:  Test execution of nested macros.
2022-10-02 17:05:28 +02:00
Erik Auerswald
ef17ae467e ftp: Avoid NULL pointer dereference with nmap
This fixes the problem reported by AiDai in
<https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00004.html>.

* NEWS: Mention fix.
* ftp/cmds.c (setnmap): Accept both space and tab characters
between command arguments.
2022-10-01 18:25:34 +02:00
Erik Auerswald
9dd2ccb8de ftp: Avoid heap buffer overflow in macro execution
This fixes the problem reported by ZFeiXQ in
<https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00016.html>.

* NEWS: Mention fix.
* ftp/domacro.c (domacro): Check buffer size before copying
into buffer.  Reallocate buffer of sufficient size if necessary.
2022-09-25 14:39:21 +02:00
Erik Auerswald
ff46109638 ftp: Avoid integer overflow in macro execution
This fixes the problem reported by AiDai in
<https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00003.html>.

* NEWS: Mention fix.
* ftp/domacro.c: Include limits.h.
(domacro): Avoid signed integer overflow.  Avoid out-of-bounds
buffer access.
2022-09-25 13:22:32 +02:00
Alfred M. Szmidt
6d519229fa Happy GNU 2022 year! 2022-01-01 17:23:02 +01:00
Simon Josefsson
1d5c923528 maint: Use copyright year ranges for readability.
* cfg.mk (update-copyright-env): Add, from coreutils.
(VC_LIST_ALWAYS_EXCLUDE_REGEX): Add, for update-copyright exceptions.
* README: Add info about copyright year ranges.
* *: Update copyright notices.
2021-09-03 18:41:09 +02:00
Simon Josefsson
0ceee23262 Use gnulib module 'attribute' instead of obsolete 'snippets/unused-parameters'.
* */*.c: Use MAYBE_UNUSED instead of _GL_UNUSED_PARAMETER.
* */*.c: Include attribute.h instead of unused-parameters.h.
2021-09-01 22:49:18 +02:00
Simon Josefsson
58cb043b19 ftp: check that PASV/LSPV addresses match.
* NEWS: Mention change.
* ftp/ftp.c (initconn): Validate returned addresses.
2021-09-01 09:17:06 +02:00
Simon Josefsson
ef2060d535 ftp: Fix usage under Emacs AngeFTP on Mac OS.
* NEWS: Doc fix.
* doc/inetutils.texi (ftp invocation): Improve --no-edit.
* ftp/main.c (main): Disable readline when TERM unset or dumb,
inspired by trivial patch from Alex Bochannek <alex@bochannek.com>.
2021-05-26 15:29:26 +02:00
Alfred M. Szmidt
91ad03852a Fix possible buffer overflow in ftp.
* ftp/ftp.c (getreply): Fix possible buffer overflow (backport
from OpenBSD); reported by O. Bittner, D. Maier, M. Munier,
J. Beier of SecT, TU Berlin.
2021-02-01 11:28:47 +01:00
Alfred M. Szmidt
911413ea57 Happy GNU 2021 year! 2021-01-01 11:35:27 +01:00
Mats Erik Andersson
6b47c25d62 Update ChangeLog, giving some more details.
Fix comment in two files to match present code.
2020-05-09 22:58:38 +02:00
Mats Erik Andersson
705750b8b4 Support for libidn2 in addition to libidn.
Prefer libidn2 when both are present and usable.
2020-04-05 16:21:30 +02:00
Tim Rühsen
e99cdac15e ftp/domacro.c: Silence -Wimplicit-fallthrough 2020-02-29 19:14:32 +01:00
Tim Rühsen
1e72ad6489 ftp/cmds.c: Silence -Wimplicit-fallthrough 2020-02-29 19:13:19 +01:00
Tim Rühsen
79c8b8f1b0 ftp/cmds.c: Fix multipliers for M(ega) and G(iga) 2020-02-29 19:11:04 +01:00
Tim Rühsen
424fb86598 ftp/cmds.c: Fix return value of remglob 2020-02-29 19:05:18 +01:00
Tim Rühsen
0c63e144a5 ftp: Fix strncpy misuse (leading to buffer overflow) 2020-02-29 19:01:40 +01:00
Tim Rühsen
961fcfa007 ftp: Fix 2x misuse of strncpy (read buffer overflow) 2020-02-29 18:57:47 +01:00
Mats Erik Andersson
71ece60ff8 Minor portability glitches in Solaris and in AIX. 2020-01-18 17:47:05 +01:00
Simon Josefsson
d8de4587f2 Update copyright years to use intervals up to 2020. 2020-01-01 13:21:37 +01:00
Alfred M. Szmidt
d0496fa7d0 ftp/main.c (main): Don't assume that uninitialized argv[argv] is NULL. 2017-06-22 10:12:10 +02:00
Mats Erik Andersson
56fc0cc15d ftp: Portability to Android.
Add external declaration of getpass().
Tiny patch by Fredrik Fornwall <fredrik@fornwall.net>.
2017-03-02 16:20:47 +01:00
Mats Erik Andersson
3d64a8c728 Update copyright years to 2017. (silent change) 2017-02-21 14:25:23 +01:00
Mats Erik Andersson
891d8ff98e ftp: Allow remote user in command.
Implement the extended host argument form `user@host'
for quick selection of the remote user name.
2016-01-23 22:47:41 +01:00
Mats Erik Andersson
84dcf08568 Update copyright years to 2016. (silent change) 2016-01-22 19:09:49 +01:00
Guillem Jover
78cd4a2deb * ftp/cmds.c (setpeer): Misspelled message. 2015-06-06 23:01:46 +02:00
Mats Erik Andersson
98b0ccfc1f ftp: Accept named, non-numerical ports. 2015-05-18 19:25:16 +02:00
Mats Erik Andersson
495beb89da ftp: Honour host aliases.
Take care to preserve the desired peer's name.  Do not
replace it with its canonical name.  Bug was reported to
the list as `2015-02/msg00000.html' by John Sullivan.
2015-03-16 23:22:12 +01:00
Mats Erik Andersson
d3c9b1b8fa Update copyright years with 2015. (silent change) 2015-01-16 14:09:44 +01:00
Mats Erik Andersson
e5e91cdb14 ftp: Friendlier printing of transfer speed. 2014-08-01 00:26:08 +02:00
Mats Erik Andersson
8c7a55e6eb Portability of canonical host name.
For a numerical host name, getaddrinfo() need not set
a value for `ai_canonname'.  Protect against this.
Problem was uncovered by a system running OpenBSD 5.5.
2014-07-17 23:45:05 +02:00
Mats Erik Andersson
57c3bb4c9b ftp: Hash command semantic. 2014-07-17 23:22:30 +02:00
Mats Erik Andersson
38246ac903 ftp: Allow other locations of netrc file.
Introduce a command line option and an environment
variable to override the legacy location $HOME/.netrc.
2014-06-12 18:55:52 +02:00
Mats Erik Andersson
a776a60336 ftp: Size multipliers for hash increments. 2014-05-16 22:30:29 +02:00
Mats Erik Andersson
aa0bc87caa ftp: Detect one-time passwords.
Follow RFC 2228 when reacting to a
challange-response password request.
2014-02-10 22:56:34 +01:00
Mats Erik Andersson
ae85332551 Update copyright years with 2014. (silent change) 2014-01-18 12:23:21 +01:00
Mats Erik Andersson
b8e8c6ebc5 inetd: Logging of resolution and binding errors. 2013-12-13 10:44:29 +01:00