2020-02-29 Tim Rühsen uucpd: Fix buffer overflows. This fixes several missing string termination issues with strncpy. Also 'remotehost' with size NI_MAXHOST was strcpy'ed into 'line' which just had 32 bytes on the stack. * src/uucpd.c (dologout): Increase 'line' array in size. Use exisiting macro SCPYN instead of strncpy. 2020-02-29 Tim Rühsen uucpd: Fix 2x heap buffer overflow. Usernames >= 56 bytes would overflow the char arrays Username and Logname. This change mitigates this, but still silently truncates these arrays. Silent truncation should be checked throughout the code possibly within a more comprehensive code review. * src/uucpd.c: Increase Username and Logname to 72 bytes. (doit): Use snprintf instead of sprintf. 2020-02-29 Tim Rühsen telnet/commands.c: Use strdup instead malloc+strcpy. * telnet/commands.c (tn): Use strdup instead malloc+strcpy. 2020-02-29 Tim Rühsen telnet: Fix -Wsign-compare in suboption. * telnet/telnet.c (suboption): Explicit cast to int to silence -Wsign-compare. 2020-02-29 Tim Rühsen telnetd/state.c: Silence -Wimplicit-fallthrough. * telnetd/state.c (willoption): Use /* FALLTHROUGH */ to indicate fallthrough. 2020-02-29 Tim Rühsen telnetd: Silence unused warning for getterminaltype. * telnetd/utility.c (getterminaltype): Silence warning. 2020-02-29 Tim Rühsen ftp/domacro.c: Silence -Wimplicit-fallthrough. * ftp/domacro.c (domacro): Use /* FALLTHROUGH */ to indicate fallthrough. 2020-02-29 Tim Rühsen ftp/cmds.c: Silence -Wimplicit-fallthrough. * ftp/cmds.c (domap): Use /* FALLTHROUGH */ to indicate fallthrough. 2020-02-29 Tim Rühsen ftp/cmds.c: Fix multipliers for M(ega) and G(iga). This is *not* a fix as the git comment accidentally states. It is to silence -Wimplicit-fallthrough and to avoid multiple multiplications in case of a non-optimized build. The 'hashbytes' type needs to be reviewed later as g/G only allows digits 1 and 2 without integer overflow, which is undefined behavior. * ftp/cmds.c (sethash): Remove cascaded multiplications. 2020-02-29 Tim Rühsen ftp/cmds.c: Fix return value of remglob. * ftp/cmds.c (remglob): Turn around NULL check. 2020-02-29 Tim Rühsen ftp: Fix strncpy misuse (leading to buffer overflow). * ftp/ftp.c (hookup): Terminate string after strncpy. 2020-02-29 Tim Rühsen ftp: Fix 2x misuse of strncpy (read buffer overflow). * ftp/ftp.c (pswitch): Correctly set the terminating 0. 2020-02-29 Tim Rühsen talk: Fix uninitialized variable 'nready'. * talk/ctl_transact.c (ctl_transact): Initialize nready to 0. 2020-02-29 Tim Rühsen whois: Silence -Wimplicit-fallthrough. * whois/whois.c (main): Use /* FALLTHROUGH */ to indicate fallthrough. 2020-02-29 Tim Rühsen ping, ping6: Silence -Wimplicit-fallthrough. The comment /* FALLTHROUGH */ is well-known by several C/C++ compilers to indicate an explicit fallthrough. An alternative is the gcc attribute 'fallthrough' which is less compatible and thus not chosen here. * ping/ping.c (parse_opt): Use /* FALLTHROUGH */ to indicate fallthrough. * ping/ping6.c (parse_opt): Likewise. 2020-02-17 Tim Rühsen ping6: Fix memleak in ping_set_dest. * ping/ping6.c (ping_set_dest): Add 'const' to param 'host'. Rerrange code to avoid memory leak. * ping/ping6.h (ping_set_dest): Add 'const' to param 'host'. 2020-02-17 Tim Rühsen ping: Fix memleak in ping_set_dest. * ping/libping.c (ping_set_dest): Add 'const' to param 'host'. Rerrange code to avoid memory leak. * ping/ping.h (ping_set_dest): Add 'const' to param 'host'. 2020-02-16 Tim Rühsen libls: Remove unused variable kflag. * libls/ls.c (ls_main): Remove unused variable 'kflag'. 2020-02-16 Tim Rühsen ftpd: Fix multiple definition of 'errcatch' (gcc 10). * ftpd/extern.h: Remove 'extern' from 'errcatch'. 2020-02-16 Tim Rühsen telnetd: Fix multiple definition of 'not42' (gcc 10). * telnetd/utility.c: Remove 'extern' from 'not42'. 2020-02-16 Tim Rühsen rcp: Remove unused variable. * src/rcp.c (tolocal): Remove unused variable 'len'. 2020-02-16 Tim Rühsen telnet: Fix silent truncation (off-by-one check) If the DISPLAY variable had exactly 44 bytes, the SE byte (end sub negotiation) was silently truncated. * telnet/telnet.c: (suboption): Use >= instead of >. 2020-02-21 Mats Erik Andersson Various compiler warnings, getting closer to `-Werror'. * libls/print.c (printlong): The functions major() and minor() have no portable value type, so cast as `int'. * ping/ping.c (decode_type): Initialize HOSTNAME to NULL. * src/hostname.c (parse_opt, main) : The prototype of sethostname() is not portable, so cast as `void *'. Do this also on both members in a conditional clause. * src/logger.c (parse_level): Cast PRIORITYNAMES and FACILITYNAMES as `CODE *', since BSD-systems assign these a constant type. * src/syslogd.c (textpri, cfline): Likewise. * src/rcp.c (source, rsource): Type length of `stat.st_mode' is not portable, so cast as `int'. * src/traceroute.c (trace_write): Make loop variable I unsigned. 2020-02-20 Mats Erik Andersson rexecd, rshd: Avoid false failure message. * src/rexecd.c (doit) [HAVE_SETLOGIN]: Only call setsid() in case the session leader is different from the present process. * src/rshd.c (doit) [HAVE_SETLOGIN]: Likewise. 2020-02-20 Mats Erik Andersson rcp: Recursive reception was broken. The commit 67b49c54 broke the use case of locally receiving multiple files for a recursive copying action. This was found and established by Zhixiong Chi. Now revert the relevant part of the old commit, as the suggested patch is nearly a verbatim change back. The differences await further analysis. Original report is contained in: https://lists.gnu.org/archive/html/bug-inetutils/2019-12/msg00000.html * src/rcp.c (sink) [targisdir]: Revert to the legacy, and functional, implementation of string allocation. 2020-02-10 Mats Erik Andersson Simplify coding of test program `runtime-ipv6', by using standard getopt() library function, thus making the code self sufficient. * tests/runtime-ipv6.c: Migrate away from argp_parse() to standard getopt(). Let environment variable VERBOSE contribute a short message in case the program tests successfully. Also use AI_NUMERICSERV for completeness. 2020-02-09 Mats Erik Andersson test-snprintf: New test program. An implementation dependent feature of snprintf() is tested. The BSD unices and OpenSolaris relatives are known to be more forgiving, than is Linux/glibc and kfreebsd/glibc. The issue was brought to our attention by Zhixiong Chi in: https://lists.gnu.org/archive/html/bug-inetutils/2019-05/msg00002.html * tests/test-snprintf.c: New file. * tests/Makefile.am (check_PROGRAMS, TESTS): Add `test-snprintf'. * tests/.gitignore: Likewise. 2020-02-04 Mats Erik Andersson Buffer overflow in tftp and tftpd. Recent versions of Gnu libc and Gcc are injecting buffer checks into strcpy(). Both executables, tftp and tftpd, are effectively copying into a formally declared `char th_msg[1]', ignorant of the underlying buffer being of size PKTSIZE. Problem was reported by Mike Gilbert and Ricardo Ribalda Delgado: https://lists.gnu.org/archive/html/bug-inetutils/2017-12/msg00001.html https://lists.gnu.org/archive/html/bug-inetutils/2019-07/msg00002.html * src/tftp.c (nak): Replace strcpy() by memcpy(), after the needed calculation of string length. * src/tftpd.c (nak): Likewise. * tests/tftp.sh: New compound test with multiple requests. 2020-02-03 Mats Erik Andersson whois: AUDA services Australia. Update server name. Forwarded from Adam King: https://lists.gnu.org/archive/html/bug-inetutils/2018-07/msg00001.html * whois/tld_serv_list (.au): Update server, now at AUDA. 2020-02-03 Mats Erik Andersson Better portability for BSD install. Install hooks for programs that require root ownership, were written with GNU install in mind. Reported and suggested by Bill Cole: https://lists.gnu.org/archive/html/bug-inetutils/2018-07/msg00005.html * ping/Makefile.am (install-ping-hook): Place program switches to INSTALL_PROGRAM before file argument, thus helping BSD install. Rewrite failure comment, and add exit error code. * src/Makefile.am (install-traceroute-hook, install-rsh-hook) (install-rlogin-hook, install-rcp-hook): Likewise. 2020-02-01 Mats Erik Andersson tests: Less system logging. * tests/ftp-localhost.sh (LOGGING): New variable. Let the server program do system logging only if LOGGING has been defined. * tests/tftp.sh (LOGGING): Likewise. Add a test case where a non-existing file is requested. Check that the number of tries and of successes agree in order to suppress the final text. * README: Add some remarks on our testing abilities. 2020-01-31 Mats Erik Andersson whois: IP delegation update. * whois/ip_del_list: Update with entries as stated by IANA with publication date 2019-12-27. 2020-01-31 Mats Erik Andersson whois: Failure of service name. The IANA has made badly founded changes to the list of port names, promoting `nicname' and introducing the aliases list `Who Is', thus making `Who' and `Is' into functional services, and also loosing `whois'. Some systems were careless enough to adopt this badly wrought change. Reported by Shahab Vahedi in: https://lists.gnu.org/archive/html/bug-inetutils/2020-01/msg00023.html * whois/whois.c (openconn): Fall back to service `nicname', should `whois' fail. 2020-01-29 Mats Erik Andersson More work on CVE-2019-0053. Telnet protocol messages must not be corrupted when buffer overflows are detected, but should be reported as errors. * telnet/telnet.c (suboption): Check that prepared protocol message in fact fits in intermediary buffer without truncation. Tweak indentation for visibility of protocol elements in snprintf. Allocate space also for final NUL-character. * telnetd/telnetd.c (telnetdrun): Increase DATA string size by one. * telnetd/termstat.c (localstat, flowstat, clientstat): Likewise. Insufficiently declared length of string variable. * telnetd/utility.c (printsub): Declare TBUF with maximal extent. 2020-01-28 Mats Erik Andersson Better test coverage, mostly IPv6. * tests/ftp-localhost.sh [TEST_IPV6 && TARGET6]: Add the possible test cases that existed for IPv4, but did not for IPv6. [do_transfer]: Explicitly remove copied $PUTME for reliability. [TEST_IPV6 && TARGET6 && do_transfer]: New test for name mapping. * tests/syslogd.sh [do_unix_socket || do_inet_socket]: Do priority `notice' for each of local socket, IPv4 socket, and IPv6 socket, as is applicable. (COUNT_WRAP): Reworked calculation on grounds as above. [do_inet_socket && TEST_IPV6 && TARGET6]: Test facilities `user.info' and `user.debug' with IPv6. * tests/tftp.sh (do_secure_setting): Test all of $ADDRESSES. * tests/.gitignore: Add runtime-ipv6 to list. 2020-01-27 Mats Erik Andersson Portability to an old Solaris shell. * tests/tools.sh.in (EGREP, FGREP, RUNTIME_IPV4, RUNTIME_IPV6): Inside parameter substitution, put value between quotes, since some old shells stumble on non-quoted space characters. * tests/ifconfig.sh (evaluation of FORMAT): Likewise. Make sure that scripts are individually executable. * tests/ftp-parser.sh (EXEEXT): Test empty before reading tools.sh. * tests/libls.sh (EXEEXT): Likewise. * tests/ifconfig_modes.sh: Read tools.sh. 2020-01-26 Mats Erik Andersson Examination of testing scripts. * tests/ftp-localhost.sh [TEST_IPV4 && TARGET]: Implement one additional level of indentation in this large text block. Some additional fixes of indentation and improved readability. * tests/inetd.sh: Improve regex when refusing test directories. * tests/syslogd.sh: Likewise. * tests/ping-localhost.sh: Use back quotes for portability. * tests/traceroute-localhost.sh: Likewise. 2020-01-24 Mats Erik Andersson runtime-ipv6: Implicit dependency on services file. In a chrooted test environment, access to a particular resource like /etc/services, need not be granted. * tests/runtime-ipv6.c: Replace symbolic service name `tftp' by a numerical and harmless port string. 2020-01-24 Mats Erik Andersson Separation of test cases according to IPv4, and to IPv6. The two precious macros TEST_IPV4 and TEST_IPV6 are controlling whether the indicated address family is checked in our tests. Test coverage is left unequal. * configure.ac (TEST_IPV4): New macro. The new switch `--disable-ipv4' suppresses IPv4 during target `check'. * tests/Makefile.am (tools_subst): Replace @TEST_IPV4@. * tests/tools.sh.in (TEST_IPV4, RUNTIME_IPV4, RUNTIME_IPV6): New variables. (TEST_IPV4, TEST_IPV6): If either is `auto', make a runtime check for availability, and set to `no' in case of failure. * tests/runtime-ipv6.c: Implement switches `-4' and `-6', making it possible to test for either address family at runtime. [EAI_NODATA]: Return this error in a corner case, or else EAI_FAIL. * tests/ftp-localhost.sh: Remove code now existing in tools.sh.in. Separate existing test cases according to IPv4 and IPv6, by means of conditionals with TEST_IPV4 and TARGET, or TEST_IPV6 and TARGET6. [TEST_IPV4 = TEST_IPV6 = no]: Skip test. * tests/ping-localhost.sh: Likewise. * tests/syslogd.sh: Likewise. * tests/telnet-localhost.sh: Likewise. * tests/tftp.sh: Likewise. * tests/ifconfig.sh [TEST_IPV4 = no]: Skip test. * tests/inetd.sh (TARGET6): New variable. [TEST_IPV4 = TEST_IPV6 = no]: Skip test. Implement subcases for IPv6, and condition old cases on TEST_IPV4. * tests/traceroute-localhost.sh [TEST_IPV4 = no]: Skip test. [TEST_IPV4 && TARGET]: Condition each case completely. 2020-01-22 Mats Erik Andersson Correctly detect presence of IPv6. * tests/runtime-ipv6.c [AI_ADDRCONFIG] (hints.ai_flags): Add AI_ADDRCONFIG for better selectivity. 2020-01-20 Mats Erik Andersson Test robustly in absence of IPv6. For systems without functional IPv6 addressing at runtime, suppress this address family in our tests, whenever IPv6 was configured as autodetected. Helpful answer by Bruno Haible originating from effects in a Raspbian system: https://lists.gnu.org/archive/html/bug-inetutils/2020-01/msg00021.html * tests/Makefile.am (check_PROGRAMS): Add `runtime-ipv6'. * tests/ftp-localhost.sh (RUNTIME_IPV6): New variable. [TEST_IPV6 == auto]: Set TEST_IPV6 to `no' when runtime presence of IPv6 is in the negative. Thus effectively inhibiting all use within this script of IPv6 addresses. * tests/ping-localhost.sh: Likewise. * tests/syslogd.sh: Likewise. * tests/telnet-localhost.sh: Likewise. * tests/tftp.sh: Likewise. * tests/runtime-ipv6.c: New file. * configure.ac (AC_ISC_POSIX): Delete obsolete test. 2020-01-18 Mats Erik Andersson Minor portability glitches in Solaris and in AIX. * am/libcurses.m4 (IU_LIB_TERMCAP) [!_XOPEN_CURSES]: Conditionally include the header . * telnet/telnet.c [HAVE_CURSES_TGETENT & !_XOPEN_CURSES]: Likewise. * telnetd/utility.c [HAVE_CURSES_TGETENT & !_XOPEN_CURSES]: Likewise. * ftp/ftp.c (h_errno): Delete declaration, not in use. * ftpd/ftpd.c (FTP_NAMES): Assign a value to this macro. 2020-01-14 Mats Erik Andersson Make test of ftp-parser slightly more forgiving. Darwin systems might prepend a path stem to local directory. Assaf Gordon reported https://lists.gnu.org/archive/html/bug-inetutils/2020-01/msg00005.html * tests/ftp-parser.sh: Check number of responses to mixed command list, and extract any prepended path resulting from `lcd'. (DIR_STEM): New variable. This modifies matching test after `lpwd'. 2020-01-13 Mats Erik Andersson The Gnulib module `regex' requires linking that was not made explicit in our source. Discovered by Bruno Haible with AIX 7.2. https://lists.gnu.org/archive/html/bug-inetutils/2020-01/msg00012.html * talkd/Makefile.am (LD_ADD): Add $(LIBTHREAD) and $(LIB_MBRTOWC). 2020-01-13 Mats Erik Andersson Attempt to build correctly on Cygwin, new and old. Reported and suggested by Bruno Haible in https://lists.gnu.org/archive/html/bug-inetutils/2020-01/msg00013.html * configure.ac: Check for header . When it is missing disable the targets `tftp', and `tftpd'. * am/enable.m4 (IU_ENABLE_FOO): Append $EXEEXT to `target_BUILD'. 2020-01-12 Mats Erik Andersson Suppress building of remote execution commands on systems that offer no rcmd functionality. This happens with embedded systems like Alpine Linux and musl libc, as reported by Assaf Gordon and Bruno Haible. * configure.ac: Check for function rcmd(). Disable building of `rcp', `rlogin', and `rsh' when no rcmd variant is present. (WITH_RCMD): New precompiler macro. 2020-01-11 Mats Erik Andersson The glibc manual page for ether address specifies . Use this for GNU/Linux in the hope of resolving also musl libc, as used with Alpine Linux. Reported by Bruno Haible. * ifconfig/system/linux.c [HAVE_NETINET_ETHER_H]: Include the library header instead of the system specific header . 2020-01-11 Mats Erik Andersson Consistent use of `grep' tools in scripts. * configure.ac (EGREP, FGREP): New and precious variables. * tests/Makefile.am (tools_subst): Replace @EGREP@ and @FGREP@. * tests/ftp-parser.sh (reply): Use $EGREP to detect size in answer, and apply a single, alternating regex. * tests/ifconfig_modes.sh: Replace all `grep' by $GREP. * tests/inetd.sh: Likewise. * tests/libls.sh: Likewise. Drop unused `-e' flag. * tests/syslogd.sh: Likewise. Use `$FGREP -f' instead of non-portable `$GREP -f'. In two cases where `grep' needed multiple regexes, use $EGREP and alternating regexes. * tests/tools.sh.in (EGREP, FGREP): New variables. 2020-01-01 Simon Josefsson telnet: Validate supplied environment variables. CVE-2019-0053 * telnet/telnet.c (suboption): Use snprintf instead of sprintf. * telnet/utilities.c (printsub): Likewise. 2020-01-01 Guillem Jover (tiny change) * ping/ping_echo.c (struct icmp_diag): Fix typo. 2020-01-01 Simon Josefsson * NEWS: Document user-visible changes since last release. 2020-01-01 Simon Josefsson * THANKS: Credit Mats. 2020-01-01 Simon Josefsson * cfg.mk: Silence 'make syntax-check'. 2020-01-01 Simon Josefsson * bootstrap: Updated from gnulib. 2020-01-01 Simon Josefsson * telnet/telnet.c (telsnd): Telnet -E(no escape) is treating _POSIX_VDISABLE char as escape. Reported by Mikhail Bychek . 2018-11-12 Mats Erik Andersson * src/tftpd.c (main): Add LOG_NDELAY to openlog(). The file descriptor for logging must be active before chrooting happens. 2018-11-09 Mats Erik Andersson * bootstrap: Updated from gnulib. * configure.ac (AC_PREREQ): Require autoconf 2.63. Gnulib needs a more recent version due to demands put forward by libtool. 2018-09-06 Simon Josefsson * README-alpha (Development): Remove broken links. * bootstrap: Updated from gnulib. 2017-07-10 Omer Anson (tiny change) * src/hostname.c (parse_file): Free name and allocate one extra byte for it. 2017-07-10 Omer Anson (tiny change) * src/hostname.c (set_name): Handle case when hostname_new is NULL. 2017-07-10 Omer Anson (tiny change) * ftpd/ftpd.c (options) : Mention mandatory argument. 2017-06-22 Omer Anson (tiny change) * ftp/main.c (main): Don't assume that uninitialized argv[argv] is NULL. 2017-03-04 Mats Erik Andersson telnetd: Use tty, not pty on Solaris. Setting of terminal attributes as well setting of window size must be done via the slave descriptor, not the master descriptor. * telnetd/term.c [SOLARIS || SOLARIS10] (set_termbuf): New variables NAME, TTY. A call to ptsname() reveals whether `pty' is a master. Then open that file, update TTY, and call _term_setattr(). [SOLARIS || SOLARIS10] (init_termbuf): Simplify to use a single call to _term_getattr(), similar to set_termbuf(). * telnetd/termstat.c: Include . [TIOCSWINSZ && (SOLARIS || SOLARIS10)] (clientstat) : New variables NAME, TTY. Similar mechanism as above, but call ioctl with window size. [TIOCSWINSZ && (SOLARIS || SOLARIS10)] (defer_terminit): Likewise. 2017-03-03 Mats Erik Andersson Test utility displays some termcaps. * tests/Makefile.am (identify_LDADD): Set to contain `$(top_builddir)/lib/libgnu.a' and `$(LIBUTIL)'. * tests/identify.c: Include . [HAVE_TERMIOS_H]: Include , , . [HAVE_TERMIOS_H && HAVE_FCNTL_H]: Include . [HAVE_TCGETATTR] (test_flag): New macro. [HAVE_TCGETATTR] (do_termcap): New function. [HAVE_TCGETATTR] (main): Call do_termcap(). 2017-03-02 Fredrik Fornwall (tiny change) ftp: Portability to Android. Without a check for HAVE_DECL_GETPASS and without making a local function declaration, the implicit declaration causes crashes on 64-bit systems lacking declared getpass(), such as Android. Reported in: http://lists.gnu.org/archive/html/bug-inetutils/2016-10/msg00000.html * ftp/cmds.c [!HAVE_DECL_GETPASS] (user, account): Declare getpass() as external function. * ftp/ftp.c (login): Likewise. 2017-03-02 Mats Erik Andersson whois: Update Canadian TLD server. Old host name no longer exists. Reported by Neil Mayhem: http://lists.gnu.org/archive/html/bug-inetutils/2017-01/msg00000.html * whois/tld_serv_list (.ca): New host 'whois.cira.ca'. 2017-02-27 Mats Erik Andersson telnetd: Portability of TTY termcap to Solaris systems. * telnetd/term.c: Include header . [SOLARIS10 || SOLARIS] (init_termbuf): If applicable, open the slave TTY and extract terminal capabilities, since these systems do not assign a line discipline to the master PTY. New variables NAME and TTY. 2017-02-27 Mats Erik Andersson telnetd: Portable option debugging. BSD systems assign IAC and _POSIX_VDISABLE the common decimal value 255. Hence the NVT enforces value duplication more often during their transmission, than GNU and Solaris systems do. * telnetd/utility.c (printsub) : Increase suboption pointer I sufficiently to counteract duplication. This has to distinguish between in/out/none. In recursive mode, suppress newline at the end of suboption printing. * telnetd/slc.c (send_slc) : Editing characters are reported using SLC_DEFAULT rather than ignored due to SLC_NOSUPPORT, when they are not supported locally. This conforms with RFC 1184, section 2.4. The test for support checks the set 'current', not 'defset', which fits the wording found in RFC 1184. 2017-02-23 Mats Erik Andersson telnetd: Scrub USER from environment. Discard the environment variable USER. It will later be set properly for autologin, but at least one BSD system passes a preset value when telnetd starts, a value which will cause rejected login when autologin is not in effect. * telnetd/telnetd.c (telnetd_setup): Unset environment variable USER before calling getterminaltype(). 2017-02-21 Mats Erik Andersson * bootstrap: Updated from gnulib. 2017-02-21 Mats Erik Andersson telnetd: Debugging of mainly line mode options. * telnetd/telnetd.c (telnetd_run): Assemble flow control data in new string variable DATA, then send it and include for debug reporting in category 'options'. * telnetd/termstat.c (localstat, flowstat, clientstat): Likewise, also for line mode data. * telnetd/utility.c (printsub) : Test TBUF[0] to calculate replacement string, since TBUF[1] is not guaranteed to be initialized by the preceding snprintf(). 2016-05-23 Mats Erik Andersson hostname: Avoid a trailing space. Suppress the space character after the last presented IP number. Problem reported by Terje Strand in http://lists.gnu.org/archive/html/bug-inetutils/2016-04/msg00001.html * src/hostname.c (get_ip_addresses): Emit a space character only in case a further IP address will be printed. 2016-02-16 Mats Erik Andersson traceroute: Subprivileged use case. A fallback for ICMP tracing relevant to GNU/Linux is implemented, allowing a rudimentary but suid-less use case. The ability to identify intermediary hosts is missing, due to the crippled capability of receiving ICMP packets other than ICMP_ECHOREPLY. * src/traceroute.c (struct trace): New member `no_ident'. (trace_init): Initiate `t->no_ident'. : In case a raw socket for an ICMP protocol fails, fall back to a datagram socket. (trace_read) : Short circuit `ic->icmp_id != pid' with the conditional `t->no_ident == 0'. (trace_write) : New variable I. Initialize HDR to its full extent. If `t->no_ident' is non-zero, insert our intended target as payload of HDR for trace identification. 2016-02-12 Mats Erik Andersson ping: Implement subprivileged echo method. Add fallback code usable by GNU/Linux to create a datagram socket for sending ICMP ECHOREQUEST. The change is related to issue #37252. * ping/libping.c (useless_ident): New variable. (ping_init): When a raw socket fails, fall back to a datagram socket. In case of success, increase `useless_ident' since the kernel choses a packet identity, overwriting our choice. (my_echo_reply, ping_recv): Short circuit the tests for packet identity with the value of `useless_identity'. 2016-02-09 Mats Erik Andersson * configure.ac (missing ipv6 or icmp6): Disable `ping6' using the macro IU_DISABLE_TARGET. 2016-01-23 Mats Erik Andersson ftp: Allow remote user in command. Ability implemented after a query by Andreas Adamcik, on the legacy use of getlogin() versus the more admitting getuid(). * ftp/ftp.c (hookup): Check for an embedded at-sign in the input variable `host', keeping the rightmost part. New variable P. (login): Likewise, but also using the string part to the left of the last at-sign as remote user name. * doc/inetutils.texi (ftp invocation): Document this ability. * NEWS: Likewise. 2016-01-22 Mats Erik Andersson * bootstrap: Updated from gnulib. 2015-12-29 Mats Erik Andersson tests/ftp-localhost.sh: Incomplete error handling. The use of sysctl(8) with option `set -e` active during script execution needs a robust exception handler. Reported by Ingo Brückl in http://lists.gnu.org/archive/html/bug-inetutils/2015-12/msg00000.html * tests/ftp-localhost.sh: Locate sysctl(8) using `command` with an augmented search path. When computing VALUE_V6ONLY in a subshell, add a short circuit with `true` to prevent interruption of the test script. (SYSCTL): New variable. 2015-10-08 Mats Erik Andersson syslogd: Redefine faulty macro LOG_MAKEPRI whenever needed. Systems with Glibc header file prior to 2.17, are not correctly defining the helper macro LOG_MAKEPRI. This effects our syslog service whenever it receives kernel messages from a remote host. The issue was mentioned in Debian's BTS as report #729666. * src/logprio.h [LOG_MAKEPRI]: Check that the macro does not shift the first argument. If it does, undefine it and apply our corrected definition. * src/syslogd.c [LOG_MAKEPRI]: Likewise. Display a precompiler warning to the effect that we have diagnosed an issue. 2015-09-15 Mats Erik Andersson * doc/inetutils.texi (ifconfig invocation): New chapter. 2015-08-19 Mats Erik Andersson AIX systems have a system call send_file(). Rename our calls. * src/tftp.c (send_file): Rename to... (tftp_sendfile): ... this. (put): Call tftp_sendfile, not send_file. * src/tftpd.c (send_file): Rename to... (tftpd_sendfile): ... this. (formats): List tftpd_sendfile call, not send_file. 2015-08-15 Mats Erik Andersson telnetd: Premature connection closure. When many connections are attempted in quick succession, a substantial number of them are cancelled. This does not appear for manual use cases, but for contrived automated set-ups. The cause seems to be a change in the evaluation of pty_read(), which was done to coincide with the condition in use by the original BSD implementation. Issue reported and suggested by Chris Severance in http://lists.gnu.org/archive/html/bug-inetutils/2015-07/msg00006.html * telnetd/telnetd.c (telnetd_run): Break the loop only by the stronger condition `pty_read() < 0', i.e., only on non-masked read errors. This reverts a change introduced in 2015-03-15. * telnetd/utility.c (pty_read): Add a comment that the read errors EWOULDBLOCK, EAGAIN, and EIO are treated specially. 2015-08-07 Mats Erik Andersson ifconfig: Statistics for BSD systems. * ifconfig/system/bsd.c (system_fh_ifstat_query) (get_if_data_by_name, system_fh_missing_stat): New functions. (_IU_DECLARE2): New macro. (system_fh_rx_bytes, system_fh_rx_dropped, system_fh_rx_errors) (system_fh_rx_packets, system_fh_tx_bytes, system_fh_tx_errors) (system_fh_tx_packets, system_fh_collisions): New functions defined using _IU_DECLARE2. (system_fh_tx_dropped): New function. * ifconfig/system/bsd.h (_IU_CAT2, _IU_DCL, _IU_EXTRN): New macros identical to those in `ifconfig/system/linux.h'. (SYSTEM_FORMAT_HANDLER) : New handler hooks. (system_fh_ifstat_query, system_fh_missing_stat): New prototypes. (system_fh_rx_bytes, system_fh_tx_bytes, system_fh_rx_dropped) (system_fh_tx_dropped, system_fh_rx_errors, system_fh_tx_errors) (system_fh_rx_packets, system_fh_tx_packets, system_fh_collisions): New prototypes generated by _IU_EXTERN. 2015-08-02 Mats Erik Andersson ifconfig: Verbose report on changed flags. * ifconfig/changeif.c (set_flags): In verbose report mode, compose a message to name those flags that were set, and also those that were cleared. 2015-08-01 Mats Erik Andersson ifconfig: Apply flags correctly. When finalizing actions, some flags could be forgotten. In particular, the flag 'up' was ignored whenever an address was assigned at the same time. This is related to the fact that an invocation only effecting interface flags, still resulted in a full printout if interface status. This latter behaviour differs from all other implementations and is rather annoying. The issue was detected and reported by Hans-Peter Budek in http://lists.gnu.org/archive/html/bug-inetutils/2015-07/msg00000.html * ifconfig/options.c (pending_setflags, pending_clrflags): Define as static variables. (pending_valid): New variable. (argp_options) : Delete the claim that 'up' be a default action together with address. (parse_opt_set_flag): When `ifp' exists, update `ifp->valid' with IF_VALID_FLAGS. Otherwise, update `pending_valid'. (parse_opt_finalize): If `ifp' exists and `pending_valid` is set, then update `ifp->valid'. The update of `ifp->setflags' and `ifp->clrflags' is performed independently of assigning an output format, as the latter would cause a printout also when only some flag is being altered. * ifconfig/options.h (IF_VALID_FLAGS): New macro. (IF_VALID_HWADDR): Updated value. (pending_setflags. pending_clrflags): Removed declaration. 2015-07-30 Mats Erik Andersson ifconfig: A work-around specific to GNU/Hurd. This system uses a mixture of BSD definitions and GNU/Linux interfaces. In particular, some care is needed to check interface hardware type. * ifconfig/system/hurd.c (_ARP_MASK): New macro. (arphrd_symbols): Apply _ARP_MASK to each member `value'. 2015-07-25 Mats Erik Andersson ifconfig: Symbolic name as peer address. * ifconfig/changeif.c (set_dstaddr): Adapt code block used by set_address(), thereby first using either getaddrinfo() or gethostbyname() to resolve a possibly symbolic peer destination, then setting the established address. 2015-07-25 Mats Erik Andersson ifconfig: Support changing of hardware address. Implement the setting of link level addresses for systems running GNU/Linux. * ifconfig/changeif.c [HAVE_NETINET_ETHER_H]: Include header . (set_hwaddr): New function. (configure_if): Call set_hwaddr() whenever `ifp->valid' contains IF_VALID_HWADDR. * ifconfig/options.c (ifconfig_initializer): Add a further NULL at the end. (parse_opt_set_hwaddr): New function built by the generic macro PARSE_OPT_SET_ADDR. * ifconfig/options.h (struct ifconfig): Define IF_VALID_HWADDR and add a new member `hwaddr'. (parse_opt_set_hwaddr): New prototype. * ifconfig/system/linux.c (system_help): Add parsed option `ether|hwaddr|lladdr MACADDR'. (system_parse_opt_rest): New enum value EXPECT_HWADDR. Insert this into the parser, triggering on all the keywords `ether', `hwaddr', and `lladdr' for best portability. 2015-07-21 Mats Erik Andersson ifconfig: Implement a hardware list for BSD systems. Patterned on the hardware recognition already in use by GNU/Linux, use a similar mechanism for all of BSD. * ifconfig/system/bsd.c (print_hwaddr_ether): New function. (ift_symbols): New variable. (ift_findvalue): New function. (system_fh_hwaddr_query, system_fh_hwaddr) (system_fh_hwtype_query, system_fh_hwtype): Adjust mechanisms to use the table `ift_symbols' via ift_findvalue(). ifconfig: Report tunnels in two more formats. * ifconfig/options.c (formats) : Add two entries for the endpoints of tunnels. : Add a line to display tunnels. ifconfig: Add a missing interface flag. * ifconfig/flags.c [IFF_CANTCONFIG] (if_flags): Add the extended interface flag `CANTCONFIG'. 2015-07-20 Mats Erik Andersson ifconfig: More info on tunnel interfaces. * ifconfig/options.c (formats) : Add destination address for point-to-point interfaces. It is present in some other formats. : Display tunnel addresses for p-t-p interfaces. : Add destination address for p-t-p interfaces and hardware type and hardware address for any device. * ifconfig/system/bsd.c (system_fh_brdaddr_query): Check that IFF_BROADCAST is set and access the relevant member `fp->ifa_broadaddr'. (system_fh_brdaddr): Check for set IFF_BROADCAST. (system_fh_tunnel_query, system_fh_tundst, system_fh_tunsrc): New functions. * ifconfig/system/bsd.h (SYSTEM_FORMAT_HANDLER): Add the keys `tunnel?', `tundst', and `tunsrc'. (system_fh_tunnel_query, system_fh_tundst, system_fh_tunsrc): New prototypes. 2015-07-18 Mats Erik Andersson rcp: Integer overflow. During transmission of large files, size exceeding 2GB, a long integer variable overflows. Issue reported and identified by Wenlin Kang in http://lists.gnu.org/archive/html/bug-inetutils/2015-07/msg00004.html * src/rcp.c (sink): Change SIZE to have type `off_t'. 2015-07-18 Mats Erik Andersson ifconfig: Improve the support for GNU/Hurd. Add system specific abilities, including parsing of command line and hardware addresses. * ifconfig/system.h [__GNU__]: Include "system/hurd.h". * ifconfig/system.c [__GNU__]: Include "system/hurd.c". * ifconfig/system/Makefile.am (noinst_HEADERS): Add the files `hurd.h' and `hurd.c'. * ifconfig/system/hurd.h, ifconfig/system/hurd.c: New files. * ifconfig/system/generic.c: Include . (system_parse_opt, system_parse_opt_rest, system_configure): Apply _GL_UNUSED_PARAMETER to all arguments, as these functions are placeholders and no-ops. 2015-07-17 Mats Erik Andersson ifconfig: Sporadically appearing regression. Device flags are sometimes calculated before their query using SIOCGIFFLAGS. First observed on GNU/Hurd. * ifconfig/printif.c (fh_brdaddr_query, fh_dstaddr_query): Execute ioctl(SIOCGIFFLAGS) before calculating UFLAGS. 2015-05-27 Alfred M. Szmidt * Makefile.am (ACLOCAL_AMFLAGS): New variable. 2015-06-06 Guillem Jover * ftp/cmds.c (setpeer): Misspelled message. 2015-05-22 Guillem Jover libls: Alignment issue on sparc systems. The test suite executed by Debian's build daemon uncovered a failure on sparc due to incomplete alignment on word boundaries. * libls/fts.c (ALIGNBYTES, ALIGN): New macros. (fts_alloc): Add ALIGNBYTES to the size being allocated to P, a structure FTSENT. Then compose the assignment of `P->fts_statp' with macro ALIGN to force correct alignment for the pointer to `struct stat'. 2015-05-19 Mats Erik Andersson ifconfig: Fix BSD-specific interface access. Recently FreeBSD abandoned support for ioctl calls with SIOCGIFNETMASK and SIOCGIFBRDADDR. Instead the use of `struct ifaddrs' is the only mechanism. This had already been put to use in other cases, and is portably available in all BSD flavours. * ifconfig/system/bsd.c (system_fh_brdaddr_query) (system_fh_brdaddr, system_fh_netmask_query, system_fh_netmask): New functions. * ifconfig/system/bsd.h (SYSTEM_FORMAT_HANDLER): Add the new functions to this list, thus replacing the default handlers. Also add their prototypes. 2015-05-18 Mats Erik Andersson ftp: Accept named, non-numerical ports. * ftp/cmds.c (setpeer): Test whether port string looks numerical. Perform a look-up in the contrary case. 2015-05-17 Mats Erik Andersson ifconfig: Regression during interface selection. Without arguments, ifconfig is expected to print status of all interfaces that are in state `UP'. The mechanism to detect this state was corrupted when 32-bit flags were implemented. The issue was reported by Juergen Daubert in http://lists.gnu.org/archive/html/bug-inetutils/2015-05/msg00002.html * ifconfig/printif.c (fh_ifdisplay_query): Logically invert every use of N. [SIOCGIFFLAGS] (fh_ifdisplay_query): Calculate UFLAGS after executing `ioctl(SIOCGIFFLAGS)', since only then is the value of `form->ifr->ifr_flags' valid. This side effect of ioctl() was not taken into account in previously committed code with 32-bit flags. 2015-05-13 Guillem Jover ping, ping6: Always use line buffered output. When stdout is redirected, libc will change the stream to be fully buffered. Suppress this, gaining the standard behaviour of other implementations. Issue was first reported as a wishlist bug of Debian: https://bugs.debian.org/782727. * ping/ping.c (main): Request line buffering on stdout, adding a call to setvbuf(). * ping/ping6.c (main): Likewise. 2015-05-12 Alfred M. Szmidt * bootstrap.conf (gnulib_modules): Add announce-gen. 2015-05-02 Mats Erik Andersson * tests/inetd.sh (PASSWD, PWDDB, PROTOCOLS): New variables. Check for system files required by `inetd'. Skip test when not found, which can happen in incomplete chroots. 2015-04-17 Mats Erik Andersson * ftpd/conf.c, ftpd/ftpd.c, ifconfig/system/bsd.c, ifconfig/system/linux.c, libtelnet/encrypt.c: Remove duplicate semicolon. 2015-04-16 Mats Erik Andersson * cfg.mk (git-version-gen-tag-sed-script): New variable using the same sed script as found in `configure.ac'. It is needed to get a more reliable target `dist'. * tests/.gitignore: Add some generated test products. 2015-04-15 Mats Erik Andersson * bootstrap: Updated from gnulib. * doc/.gitignore: Add `/gendocs_template_min'. The file is added during bootstrap. 2015-04-09 Mats Erik Andersson Incomplete test of syslogd. Whenever message passing via local socket is disabled, the wrapping test caused a false negative. Fix this by letting it fall back to an INET socket. * tests/syslogd.sh: Include the `wrapping message' whenever either of $do_unix_socket or $do_inet_socket is true. Fix the counter COUNT_WRAP to be set under the same prerequisite only. 2015-04-08 Mats Erik Andersson syslogd: Overlapping string locations. Configuration lines with leading white space are normalized by copying a string to an overlapping location. Issue found by Alex Kost and reported to us in http://lists.gnu.org/archive/html/bug-inetutils/2015-04/msg00001.html * src/syslogd.c (load_conffile): Declare P in smallest possible code block. Use `memmove' instead of `strcpy' to neutralize the effects of overlapping locations. * tests/syslogd.sh: Add a new test case, checking resistance to leading white space and wrapped lines in configuration file. (OUT_NOTICE, COUNT_NOTICE, wrapped, COUNT_WRAP): New variables. 2015-04-02 Mats Erik Andersson Testing of inetd service. * tests/inetd.sh: In verbose mode, report the value of USER. Include a printout of the configuration file when the SIGHUP test loop fails. 2015-03-31 Alfred M. Szmidt * doc/inetutils.texi: Re-order chapters. 2015-03-30 Mats Erik Andersson Texinfo: Slight reordering of nodes. This makes all chapters consistent in themselves. * doc/inetutils.texi: Put direntry `dnsdomainname' first in dircategory `Individual utilities', for alphabetic reasons. Interchange nodes `dnsdomainname invocation' and `hostname invocation' in response to that change. (ftp invocation): In sub-menu, move `The .netrc file' to be last entry in the list. Move the node `Ftp environment' from last to third relative position in this chapter. Position three comes from the ordering in the established sub-menu. 2015-03-30 Mats Erik Andersson Texinfo: Improve typeset output. * doc/inetutils.texi: Replace all @smallexample by @example. (inetd invocation): Make the multi-line example two spaces narrower in order to fit into a rendered PDF page. (tftpd invocation): Rephrase a sentence for easier line breaks, thus avoiding text extending into the right margin. 2015-03-21 Mats Erik Andersson Portability of time format string. * telnetd/utility.c (_var_short_name) : Change `%P' to `%p' in format string for strftime(), as the former is a GNU exclusive extension of no portability at all. Another conversion specifier `%l' is not POSIX conforming, but seems to be generally supported, so it is left untouched. 2015-03-20 Mats Erik Andersson telnetd: Texinfo documentation. * doc/inetutils.texi (telnetd invocation): Add a section on the use of replacement tokens in the execution string. 2015-03-19 Mats Erik Andersson telnetd: Enable autologin in legacy mode. Without Kerberos authentication the autologin code was not determining what user name to hand over to the login service. Adding the user name, when applicable, resolves the issue. Bug was reported by Kuaikuai Wu in http://lists.gnu.org/archive/html/bug-inetutils/2014-12/msg00010.html * telnetd/telnetd.c [SOLARIS10] (login_invocation): Add device path "-d %L" and user name "%U", the latter in the form of an else clause to the selector "%?u". [!SOLARIS10] (login_invocation): Likewise for "%U" only. * telnetd/utility.c (getterminaltype): Change the paramater name `user_name' to `uname', as the former shadows a precious and global variable name. (_var_short_name) : New case, returning full path to the PTY device assigned to client. : New case, returning a copy of the environment variable USER, or an empty string. 2015-03-16 Mats Erik Andersson ftp: Honour host aliases. While establishing the connection, do not replace the desired peer name with its canonical name. This prevents correct use of the netrc file. Bug reported by John Sullivan in http://lists.gnu.org/archive/html/bug-inetutils/2015-02/msg00000.html * ftp/cmds.c (setpeer): Do not assign value from hookup() to HOST. Instead, only test if it is non-null. 2015-03-15 Mats Erik Andersson telnetd: Suppress PTY packet data. The server is receiving PTY input in packet mode, but is not properly discarding PIOCPKT_DATA before handing over input to the network socket. Do this correctly. * telnetd/telnetd.c (telnet_run) : Break the loop also if pty_read() returns zero. Add a final call to pty_get_char() before ending FD_ISSET(pty, &ibits). This call was mistakenly located within the subcase where TIOCPKT_NOSTOP or TIOCPKT_DOSTOP is handled. 2015-03-14 Mats Erik Andersson Complaints during IPv6-less testing. Unused IPv6 directives cause logged complaints by inetd. * tests/ftp-localhost.sh: Add a tcp6 listener to `inetd.conf' only if TEST_IPV6 is not `no'. * tests/tftp.sh: Likewise with udp6. 2015-03-14 Mats Erik Andersson Build failures while IPv6 is disabled. * configure.ac (ENABLE_hstrerror): New conditional variable. * src/rlogind.c [IPV6] (checkhost): Move right parenthesis outside of precompiler conditional. * telnetd/Makefile.am [ENABLE_hstrerror]: Add $(LIBRESOLV) to LDADD. With IPv6 disabled, the code in `telnetd/telnetd.c' uses hstrerror(), so Solaris must link against libresolv. 2015-02-28 Mats Erik Andersson Fully configure testing without IPv6. Pick up testing addresses for IP and IPv6 at configuration time. Now a BSD jail can successfully test all network services. * configure.ac (TARGET, TARGET6): New precious variables. Set their default values. * tests/Makefile.am (tools_subst): Add TARGET and TARGET to substi- tution rules. * tests/tools.sh.in (TARGET, TARGET6): New variables. * tests/ifconfig.sh (TARGET, target): New variables. (find_lo_addr): Replace hardcoded `127.0.0.1' with `$target'. * tests/ping-localhost.sh : Add a test `$TEST_IPV6 != no'. * tests/syslogd.sh (TARGET6): Remove surrounding brackets. <$TEST_IPV6 != no>: Enclose `$TARGET6' in brackets for `$LOGGER'. 2015-02-27 Mats Erik Andersson Allow testing without IPv6. Configuration with `--disable-ipv6' as well as individual tests with `TEST_IPV6=no' need to avoid mandatory IPv6. * configure.ac (TEST_IPV6): New precious variable. * tests/Makefile.am (tools_subst): Add substitution of TEST_IPV6. * tests/tools.sh.in (TEST_IPV6): New variable. * tests/ftp-localhost.sh: Check `$TEST_IPV6 != no' before adding any test cases with IPv6 addressing. * tests/syslogd.sh: Likewise. * tests/telnet-localhost.sh: Likewise. (TARGET46): New variable, defaulting to `::ffff:$TARGET'. * tests/tftp.sh (TARGET, TARGET6): New variables. <$ADDRESSES = sense>: Compute this case before building a default address list. Add switch `-a' when executing $IFCONFIG. (ADDRESSES): Start with TARGET, add TARGET6 if `$TEST_IPV6 != no'. 2015-01-31 Mats Erik Andersson telnet: Printing of uninitialized characters. When preparing submodes of linemode for presentation, in case no submode is set, the string to be printed might make use of uninitialized string content, in an otherwise sane call to fprintf(). This is in error already in the legacy code. * telnet/utilities.c (printsub) : Test TBUF[0] to calculate replacement string, since TBUF[1] is not guaranteed to be initialized by the preceding sprintf(). 2015-01-30 Mats Erik Andersson * bootstrap: Updated from gnulib. 2015-01-20 Mats Erik Andersson telnetd: Incomplete processing of PTY data. The reception of SIGCHLD can make the transfer of data from the PTY stream to the client side's network stream incomplete. The problem was raised as Debian Bug #607415, but is applicable also here, due to a common origin. A setting with the option `-E /some/script' displays this error irregularly. * telnetd/telnetd.c (pending_sigchld): New variable. (telnetd_setup): Call setsig() when assigning SIGCHLD. Set the action to chld_is_done(). (telnetd_run) : If pending_sigchld is set, flush the network output buffer and exit the loop with cleanup(SIGCHLD). (chld_is_done): New function, used as signal action. * telnetd/utility.c (pty_read) : Set consistent text prefixes in output. (printdata): Cast char array value as `unsigned char' to avoid an implicit cast as integer, implied in the format string `%02x'. 2015-01-17 Mats Erik Andersson * telnetd/state.c (dooption) : Remove outdated and misnamed ifdef on TELOPT_ENVIRON. (suboption): Remove outdated ifdef on TELOPT_NEW_ENVIRON. (send_status) : Pass only the suboption payload into printsub(), by stepping over IAC+SB in the string buffer. * telnetd/utility.c (printsub) : When an unexpected mode must be reported numerically, print the correct byte in pointer[0], not some other pseudo-random value. 2014-11-11 Mats Erik Andersson * bootstrap: Updated from gnulib. 2014-11-11 Mats Erik Andersson ping: Fix testing when ping6 is not built. Reported by jb999 in bug-inetutils. * tests/ping-localhost.sh: Bracket test clauses to conform with intuitive logic and precedence rules. 2014-10-17 Mats Erik Andersson syslogd, logger: Incomplete range checking. * src/logger.c (IU_MAX_FAC): Delete macro. (decode): Use LOG_FACMASK in range checking. The use of numeric facilities was broken for the most part. * src/logprio.h [!LOG_MAKEPRI] (LOG_MAKEPRI): Change to a portable and correct definition. [!INTERNAL_MARK] (INTERNAL_MARK): Adjust to the corrected behaviour of LOG_MAKEPRI. * src/syslogd.c [!LOG_MAKEPRI] (LOG_MAKEPRI): Change to a portable and correct definition. (printline): Reset `pri' to DEFUPRI whenever the facility is non-existent. This protects against CVE-2014-3684. Make a three bit shift of LOG_KERN for code consistency. (cfline): After decoding priority, check also upper limit. Likewise for facility, and update `facilities_seen' only after a completed range error check. * tests/syslogd.sh (OUT_UNOTICE, OUT_LOCAL0): New variables. (COUNT4, COUNT5, COUNT4_notice, COUNT4_illegal, COUNT5_user) (COUNT5_local): Likewise. Add three new configuration stanzas to initial setup, all with invalid information. In the second setup, capture facility `info' exactly, and make a new `notice' also exact. Add a further file in the conf-directory, specifying capture of `local0.=notice'. Add five new test messages using Unix socket, intending to detect more accurately the handling of priorities, numerical as well as illegal or default values. 2014-08-29 Mats Erik Andersson * tests/libls.sh: Add a dummy execution of $LS in order to avoid a false negative caused by code coverage runs. 2014-08-13 Mats Erik Andersson * tests/libls.sh : Execute `set -x'. (REPLY_a1, REPLY_A1, diff): Changed. Update the check based on these, thus avoiding `sed -n '$='' which could not be trusted on NixOS' build daemon. 2014-08-11 Mats Erik Andersson * tests/libls.sh: Improve failure diagnostic when testing the switches `-a' and `-A'. The build daemon at NixOS had an issue during this subcase. 2014-08-03 Mats Erik Andersson Support libshishi with Sun Studio. * configure.ac : Call AC_SEARCH_LIBS, not AC_CHECK_LIB, when looking for libshishi. This allows the C-compiler from Sun Studio 12.1 to correctly detect and build shishi support. 2014-08-02 Mats Erik Andersson More tests for better code coverage. * tests/Makefile.am [ENABLE_libls] (dist_check_SCRIPTS): Add `libls.sh'. [ENABLE_ftp] (dist_check_SCRIPTS): Add `ftp-parser.sh'. * tests/ftp-parser.sh: New script. * tests/ifconfig.sh: Add more test cases. * tests/libls.sh: New script. * ifconfig/options.c (formats): Add format `?' as a synonym for format `help'. 2014-08-01 Mats Erik Andersson ping, ping6: Repair pattern production. A pattern stated on the command line was never made productive, instead only nulls were inserted to the correct length. * ping/ping.c, ping/ping6.c (pattern_len): Set to MAXPATTERN. (parse_opt): Size of PATTERN is now MAXPATTERN. * ping/ping_common.h (MAXPATTERN): New macro. * ping/ping_common.c (init_data_buffer): Increment I before checking for end of pattern. This avoids an insertion of the closing null character. (decode_pattern): Remove _GL_UNUSED_PARAMETER on `pattern_data'. Insert scanned data C into pattern buffer. 2014-08-01 Mats Erik Andersson * ftp/ftp.c (ptransfer): Change BS to be of type float. Improve readability by having speed estimates printed as `Mbytes/s', `kbytes/s', or `bytes/s' as suitable. 2014-07-30 Alfred M. Szmidt * telnetd/utility.c (nextitem, netclear, printoption, printsub) (printdata): Remove register keyword usage. (printsub): Don't add integer to string to try and skip quote. 2014-07-28 Giuseppe Scrivano * tests/ls.c: Include not "config.h". 2014-07-26 Mats Erik Andersson whois: Cooperate with misbehaving servers. Some servers, like "whois.ripe.net", "whois.arin.net", and "whois.eu", partially abort communication when the socket is closed for writing. Report by Alexander Zubkov: . * whois/whois.c (gwhois_argp_options): Increase GRP and insert a separating subheader. (do_query): Remove call to shutdown(). The alternate and much similar lookup call query_crsnic() did not half-close the socket for writing. * doc/inetutils.texi (whois invocation): Add a section about environment variables accessed by `whois'. 2014-07-22 Mats Erik Andersson libls: Inconsistent options. The options '-l', '-m' and '-n' were not overruling each other in the expected manner. Build `ls' from `libls' for testing purposes, but do not install it. * configure.ac (enable_libls): Set to `no' when testing against `ac_cv_func_fchdir' fails. Publish with AC_SUBST. [ENABLE_libls]: New variable. * summary.sh.in (libls_BUILD, libls_PROPS, enable_libls): Detect these; report whether `libls' is being built. * libls/ls.c (ls_main) <'l' || 'm' || 'n'>: Reset missing flags correctly, in order that '-l', '-m' and '-n' overrule each other on the command line. * tests/Makefile.am [ENABLE_libls] (noinst_PROGRAMS): Add `ls'. [ENABLE_libls] (ls_LDADD): New variable. * tests/ls.c: New file. 2014-07-17 Mats Erik Andersson Portability of canonical host name. In response to a numerical address, getaddrinfo() does not populate `ai_canonname' by necessity. * ftp/ftp.c (hookup): Copy `RES->ai_canonname' only if set. Copy from RHOST otherwise. * ping/libping.c (ping_set_dest): Likewise; with P. * ping/ping6.c (ping_set_dest): Likewise, with RHOST. * src/traceroute.c (main): Likewise. 2014-07-16 Mats Erik Andersson Handle access timing in fractions of a second. * configure.ac (HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC) (HAVE_STRUCT_STAT_ST_ATIM_TV_USEC, HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC) (HAVE_STRUCT_STAT_ST_CTIM_TV_USEC, HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) (HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC): Check for existing time field for sub-second timing in `struct stat'. (HAVE_STRUCT_STAT_ST_BLKSTAT): Make the macro functional! * libls/cmp.c (modcmp) [HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC] [HAVE_STRUCT_STAT_ST_MTIM_TV_USEC]: Compare in sub-seconds. (acccmp) [HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC] [HAVE_STRUCT_STAT_ST_ATIM_TV_USEC]: Likewise. (statmod) [HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC] [HAVE_STRUCT_STAT_CT_MTIM_TV_USEC]: Likewise (revmodcmp, revaccmp, revstatmod, revsizecmp): Replace code by a simple sign change of modcmp(), acccmp(), etcetera. * src/rcp.c [HAVE_STAT_ST_MTIMESPEC || HAVE_STAT_ST_MTIME_USEC] (write_stat_time): Remove unused and obsolete code. [HAVE_STRUCT_STAT_ST_ATIM_NSEC || HAVE_STRUCT_STAT_ST_ATIM_USEC] [HAVE_STRUCT_STAT_ST_MTIM_NSEC || HAVE_STRUCT_STAT_ST_MTIM_USEC] (write_stat_time): Code portably for sub-second accuracy. 2014-07-14 Mats Erik Andersson ftp: Hash command semantic. Toggle hash state when argument is not set, only then. * ftp/cmds.c (sethash): Activate marker when a numeric argument is found; toggle when no argument is present. A non-numeric argument leads to status reporting only. 2014-06-05 Mats Erik Andersson ftp: Alternate selection of .netrc file. * ftp/ftp_var.h (netrc): New variable. * ftp/main.c (argp_options) <-N/--netrc>: New option. (parse_opt) <'N'>: New case. (main): Initialize `netrc'. * ftp/ruserpass.c (remote_userpass): If `netrc' is NULL, check NETRC in environment. Whenever `netrc' has content, us it instead of `~/.netrc'. Once CFILE is valid, make sure that the file location is a regular file, otherwise returning to the interpreter. * tests/ftp-localhost.sh: Two new test cases, checking the functionality of NETRC in environment, and the option `-N'. 2014-05-16 Mats Erik Andersson ftp: Size multipliers for hash increments. * ftp/cmds.c (sethash): New variable P. Detect and apply multipliers when setting the increment size for hash markers, i.e., allow commands like "hash 32m". 2014-04-29 Mats Erik Andersson hostname: Degenerate cases. Better replies when name resolution fails. * configure.ac: Remove check for gethostname in libresolv. If hstrerror is missing, check for it in libresolv. (LIBRESOLV): New variable published using AC_SUBST. * src/Makefile.am (hostname_LDADD): New variable. * src/hostname.c (get_name): Call puts() only if NAME carries some content. Will, most importantly, reply with an empty string, not an empty line, when no aliases are found. (get_aliases): Return an empty string when the host's name cannot be resolved. (get_fqdn): Fall back to the system reported hostname when name resolution fails. [HAVE_HSTRERROR] (get_ip_addresses): Exit with an error when name resolution fails. * tests/hostname.sh: Check availability of mktemp. (posttest): New function, used as trap. : New test case with switch '-F'. 2014-04-26 Mats Erik Andersson libinetutils: Skeletal preparations for Heimdal. * configure.ac : Disable rlogind and rshd. (KERBEROS_VERSION): Publish it using AC_SUBST. * libinetutils/kerberos5.c: New file, mostly copied in from `shishi.c' as a guide. * libinetutils/Makefile.am (libinetutils_a_SOURCES): Remove `des_rw.c', and add `kerberos5.c'. * libinetutils/kcmd.c: Remove support for KRB4, replacing all macros KERBEROS by KRB5. [KRB5]: Include and "kerberos5_def.h". [KRB5] (kcmd): Update declarations, and make small, obvious adaptions to Kerberos5. (kcmd): Refactor steps common to SHISHI and KRB5, such as protocol exchange and address resolution. They differ at the end, calling shishi_auth() or kerberos_auth(). 2014-04-25 Mats Erik Andersson Begin support for Heimdal's Kerberos. Very incomplete code for `rsh', but a needed start. * libinetutils/kerberos5_def.h: New file. * libinetutils/krcmd.c: Remove support for KRB4, replacing most macros KERBEROS by KRB5. [KRB5]: Include and "kerberos5_def.h". [KRB5] (kcmd, krcmd, krcmd_mutual): Update declarations, and make small, obvious adaptions to Kerberos5. [KRB5] (krcmd_mutual): Update value of AUTHOPTS. * libinetutils/Makefile.am (noinst_HEADERS): Add `kerberos5_def.h'. * src/rsh.c: Replace macro KERBEROS by KRB5, temporarily making an exception in some code related to encryption. [KRB5]: Include and "kerberos5_def.h". [KRB5] (ctx, keyblock, server): New variables. [KRB5 && ENCRYPTION] (parse_opt) : Remove call to des_set_key(). [KRB5 || SHISHI] (main): Refactor code for port lookup and command string generation, since Kerberos5 and Shishi have common traits. [KRB5] (main): Adapt to new signatures of krcmd() and krcmd_mutual(). Initialize `ctx', and reimplement realm lookup using Kerberos5 API. 2014-04-25 Mats Erik Andersson Silence warnings with libshishi. * libinetutils/kcmd.c [KERBEROS || SHISHI] (kcmd): Declare realm argument as `const char *'. * libinetutils/krcmd.c [KERBEROS || SHISHI] (kcmd, krcmd, krcmd_mutual): Likewise. * libinetutils/shishi.c [SHISHI] (shishi_auth): Likewise. * libinetutils/shishi_def.h [SHISHI] (shishi_auth, krcmd) (krcmd_mutual): Likewise. * src/rcp.c [KERBEROS || SHISHI] (dest_realm): Likewise. * src/rlogin.c [KERBEROS || SHISHI] (dest_realm): Likewise. * src/rsh.c [KERBEROS || SHISHI] (dest_realm): Likewise. * src/rlogind.c (rlogind_auth): Initialize HOSTNAME. 2014-03-28 Mats Erik Andersson syslogd: Local time option. * src/syslogd.c (set_local_time): New variable. (option enum): Remove OPT_PIDFILE. (argp_options) : New alias 'P'. <-T/--local-time>: New option. (parse_opt) : Replaces OPT_PIDFILE. : New case. (logmsg): If `set_local_time' is set, use NOW to generate a time stamp, not the initial portion of the message. 2014-03-23 Mats Erik Andersson ifconfig: Parse address family. Allow for address family argument on supported systems. * ifconfig/system/bsd.c (system_parse_opt_rest): New enum values EXPECT_COMMAND and EXPECT_AF. Use the first to detect `create' and `destroy', but claiming lack of support. Accept `inet' as family, but reject `inet6'. Rewrite return status. * ifconfig/system/linux.c (system_parse_opt_rest): Rename enum value EXPECT_INET to EXPECT_AF. Detect family `inet6', but reject it. * ifconfig/system/solaris.c (system_parse_opt_rest): New enum value EXPECT_AF. Accept `inet' as address family argument, but reject `inet6'. Rewrite return status. 2014-03-20 Mats Erik Andersson ifconfig: Command line parsing. Implement flag parsing for BSD and Solaris. Accept only changeable flags on GNU/Linux. * ifconfig/system/linux.c (system_parse_opt_rest): Accept only masks which correspond to changeable flags, using IU_IFF_CANTCHANGE. * ifconfig/system/bsd.c, ifconfig/system/solaris.c (system_parse_opt_rest): New variables MASK and REV. Check if the command line argument can be interpreted as a changeable flag argument. 2014-03-15 Mats Erik Andersson ifconfig: Changeable flags on GNU/Linux. * ifconfig/flags.h (IU_IFF_CANTCHANGE): Remove IFF_POINTOPOINT, IFF_ALLMULTI, IFF_BROADCAST, IFF_MULTICAST, and IFF_PROMISC, since they are changeable on GNU/Linux, and they are included natively in IFF_CANTCHANGE on other systems. 2014-03-13 Mats Erik Andersson logger: Source address resolution. * src/logger.c (open_socket) [HAVE_DECL_GETADDRINFO] : Delete resolver hint for numeric address. 2014-03-10 Mats Erik Andersson hostname: Sanity checks in corner cases. * src/hostname.c (get_name): Use reply from get_fqdn() only if it gave a host name, not the artificial "(none)". (set_name): Reject an empty host name. (parse_file): Initialize NAME. Improve error message when getline() claims empty input. Break out of loop only if sscanf() produced a printable string. 2014-02-22 Mats Erik Andersson ifconfig: Allow flags richer than 16 bits. Systems like GNU/kFreeBSD and FreeBSD use two `short int' to represent interface flags. Adapt to this fact. * ifconfig/changeif.c (set_flags): Apply mask 0xffff to flags. [ifr_flagshigh]: Calculate flag changes also on ifr_flagshigh. * ifconfig/flags.c [IFF_PPROMISC] (if_flags): Add user land setable flag "PROMISC". [IFF_MONITOR] (if_flags): Add flag "MONITOR". [IFF_STATICARP] (if_flags): Add flag "STATICARP". [IFF_STATICARP] (flag_char_tab): Add short flag 's'. [IFF_MONITOR] (flag_char_tab): Add short flag 'm'. * ifconfig/options.c (formats) : Print flags numerically using format string "%x". * ifconfig/printif.c (put_flags): Change signature. New type of F is `unsigned int'. New variable UFLAGS. Work with UFLAGS, not `flags'. (put_flags_short): New signature. [SIOCGIFFLAGS] (fh_ifdisplay_query, fh_brdaddr_query) (fh_dstaddr_query, fh_flags): New variable UFLAGS, replacing `form->ifr->ifr_flags'. * ifconfig/printif.h (put_flags): Change prototype. 2014-02-15 Mats Erik Andersson ifconfig: No listing of unchangeable flags. * ifconfig/flags.h [!IFF_CANTCHANGE]: Define it as naught. (IU_IFF_CANTCHANGE): New macro. * ifconfig/flags.c (if_list_flags): Do not list flags that are known to give constant properties. New macro FLAGS_COMMENT. Add its contents to the end of the requested flags listing. Skip a named flag if it matches IU_IFF_CANTCHANGE. Also skip flags named like 'link2/altphys', since their components do appear in the listing. Portability issues in test script. * tests/ifconfig_modes.sh (MTU): Set to 1324 initially, to get above 1280 needed for IPv6 compatibility. The switch '-o' of uname is not portable. 2014-02-15 Mats Erik Andersson * tests/ifconfig_modes.sh: Add test case to explain failures to automatically bring the interface up at an address change. GNU/Linux is affected by this. 2014-02-14 Mats Erik Andersson * ifconfig/flags.c (if_list_flags): Increment counter only in the for-statement; update the insertion of list delimiters. Each second flag name was falsely scrubbed. 2014-02-14 Mats Erik Andersson Script for testing of ifconfig's modes. Will document all tested features. * tests/ifconfig_modes.sh: New file. Intentionally without execution bit, and not for automatic testing. * tests/Makefile.am (EXTRA_DIST): Add `ifconfig_modes.sh`. 2014-02-12 Mats Erik Andersson * ifconfig/options.c (formats): Add format `check' as a synonym for `check-existence'. 2014-02-09 Mats Erik Andersson ftp: Detect one-time passwords. RFC 2228 reserves response code 336 for replies used with challange-response authentication. * ftp/cmds.c (user): React to response code 336 within FTP command `USER', print its message, and possibly discard an already supplied password. * ftp/ftp.c (login): Likewise. 2014-02-09 Mats Erik Andersson ftpd: Parse commands of RFC 2228. Tokens are implemented, but no actions. * ftpd/ftpcmd.y (ADAT, AUTH, CCC, CONF, ENC, MIC, PBSZ) (PROT): New tokens. (cmdtab): New entries `ADAT', `AUTH', `CCC', `CONF', `ENC', `MIC', `PBSZ', and `PROT'. All are marked as unimplemented. 2013-12-23 Alfred M. Szmidt * doc/inetutils.texi (rsh invocation): Use @item for first entry in @table. 2013-12-19 Mats Erik Andersson * bootstrap: Updated from gnulib. 2013-12-13 Mats Erik Andersson ftpd: Follow RFC 2577 by default. Prevent user name guessing as standard, but offer an option to keep the more informational responses. * ftpd/extern.h (logged_in): Remove unused variable. (rfc2577): New variable. (struct credentials): New component DELAYED_REJECT. * ftpd/ftpd.c (rfc2577): New variable. (OPT_NONRFC2577): New enum value. (options): New option `--non-rfc2577'. (parse_opt) : Reset `rfc2577'. (user): New variable RET. After auth_user(), display messages in the old manner only if `rfc2577' is not set, or if guest access is being requested. Otherwise, update `cred.delayed_reject' for later access. (end_login): Reset `pcred->delayed_reject'. (pass): On returning from auth_pass(), check also `cred.delayed_reject' to minimize the amount of user information returned to the client. ftpd: The standard protocol in RFC 959 demands that a client be informed before closing down. * ftpd/ftpd.c (pass) : Send a reply message 421 before closing connection. 2013-12-10 Mats Erik Andersson inetd: Logging of resolution and binding errors. * src/inetd.c (setup): Alternate syslog format, and debug message, when a service node has been set. (expand_enter): Likewise, adding debug message. ftp: Trivial misspelling. Reported by Joe Steffee in . * ftp/ftp.c (hookup): Spell `response' correctly. 2013-11-28 Mats Erik Andersson rlogind, telnet, telnetd: Modify exit status. * src/rlogind.c (rlogind_mainloop): Delay cleanup() call until libshishi has torn down its structures. (cleanup): New variable STATUS. If `signo' is SIGCHLD, call waitpid() to reap the waiting child process and use its return status for the whole server's status. Waiting for the child resolves a race condition when tearing down the pseudo-terminal pair, since the slave now is gone when the master side is being closed down. * telnet/commands.c (tn): Use exit status 0 when setjmp() manages to execute telnet(). Otherwise, keep 1. (command) [unix || __unix || __unix__]: Enclose the complete else-block within preprocessor conditionals. * telnetd/pty.c (cleanup): Let STATUS have full scope in this function, and use it for exit(). Execute waitpid() only if `sig' is SIGCHLD, and update STATUS for later use. On SIGHUP, set STATUS to success, which happens only at reception of TELOPT_LOGOUT from client. * telnetd/state.c (dooption) : Call cleanup() with argument SIGHUP, since the client willingly leaves off. 2013-11-24 Mats Erik Andersson inetd: Ensure successful daemon mode. * src/inetd.c (main) : Abort with a syslog message, should daemon() return unsuccessfully. * libinetutils/daemon.c (waitdaemon): Return with failure, should chdir("/") fail. Check all calls to chdir. * src/rshd.c (doit): Make a syslog error message and abort execution, should chdir("/") fail. * src/uucpd.c (doit): Abort with a message to stderr, should chdir("/") fail. 2013-11-23 Mats Erik Andersson Check all returns from fgets. Handle every failed fgets() with care. * ftp/cmds.c (user): Set account string to empty when fgets() fails. * src/rexec.c (main): Likewise for password string. * src/tftp.c (get_args): Call makeargv() only on successful call to fgets(). Otherwise, instantiate a trivial command list containing command name only. * telnet/commands.c (setescape): Leave escape character unchanged when fgets() fails. (tn) : Call makeargv() only for successful fgets(). Otherwise, print a message and rely on later usage printout. (command): Print a line feed at EOF on stream error. 2013-11-15 Mats Erik Andersson tftp: Buffer size checking. Hardened builds need a helping hand in interpreting a bogus array length. * src/tftp.c (makerequest): New variables ARGLEN, LEN. Use them in calculating available space for file name. [HAVE_STRUCT_TFTPHDR_TH_U]: Calculate CP using an offset argument. Needed to prevent false negatives from stack allocation protectors. 2013-11-05 Mats Erik Andersson Improve detection of readline. * am/readline.m4 (gl_FUNC_READLINE): Check for libedit with AC_LIB_LINKFLAGS_BODY and with AC_CACHE_CHECK. : Ignore . : Prefer . Define HAVE_READLINE if readline() was located in one of the libraries, and if its use had not been disabled. Define HAVE_LIBREADLINE and HAVE_LIBEDIT if it was found in the corresponding library. * ftp/Makefile.am (LDADD): Remove $(LIBGLOB), $(LIBTERMCAP). The latter is handled by LIBREADLINE. * configure.ac (ftp_PROPS): Do not add $LIBTERMCAP. 2013-10-16 Mats Erik Andersson syslogd, talkd: Act on failed read_utmp. * src/syslogd.c (wallmsg) [UTMP_NAME_FUNCTION || !HAVE_GETUTXENT]: Check call to read_utmp() for failure, filing an error massage. * talkd/process.c (find_user) [!HAVE_GETUTXUSER]: Likewise, then returning FAILED. rsh: Symbolic descriptor name. * src/rsh.d (talk): Use STDOUT_FILENO and STDERR_FILENO as arguments to write(). 2013-10-16 Mats Erik Andersson rsh: Kill child process after SIGPIPE. The default action for SIGPIPE will leave the child process running. This caused, until now and including legacy implementations, blocking of stdin, and to conditionally leave also the remote server running. * src/rsh.c (end_of_pipe): New variable. (sigpipe): New function. (talk) [HAVE_SIGACTION]: New variable SA. : Assign a signal handler to SIGPIPE. Add `&& !end_of_pipe' to the loop condition, so that talk() returns after SIGPIPE. The child process will then be killed at the end of main(). 2013-10-06 Mats Erik Andersson rsh: Detach input stream. The option `-n/--no-input' was incomplete. * src/rsh.c (main) : Call shutdown(SHUT_WR) on socket REM. (talk): Use symbolic macro SHUT_WR in shutdown(). * doc/inetutils.texi (rsh invocation)