From MAILER-DAEMON Tue Jul 01 06:21:38 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1X1vBy-0004Ts-L2 for mharc-commit-inetutils@gnu.org; Tue, 01 Jul 2014 06:21:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1vBr-0004Rg-0Q for commit-inetutils@gnu.org; Tue, 01 Jul 2014 06:21:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1vBm-0005Jw-An for commit-inetutils@gnu.org; Tue, 01 Jul 2014 06:21:30 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:36138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1vBm-0005Js-7q for commit-inetutils@gnu.org; Tue, 01 Jul 2014 06:21:26 -0400 Received: from gscrivano by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1X1vBl-00051d-Mx for commit-inetutils@gnu.org; Tue, 01 Jul 2014 10:21:25 +0000 Date: Tue, 01 Jul 2014 10:21:25 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-23-gabb0bed X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 38246ac903db567f149dad428403f2182ea03b4e X-Git-Newrev: abb0bed745b939efcd4a1edcb93513cff85c6100 From: Giuseppe Scrivano X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 10:21:37 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via abb0bed745b939efcd4a1edcb93513cff85c6100 (commit) from 38246ac903db567f149dad428403f2182ea03b4e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=abb0bed745b939efcd4a1edcb93513cff85c6100 commit abb0bed745b939efcd4a1edcb93513cff85c6100 Author: Giuseppe Scrivano Date: Sat Jun 28 13:23:06 2014 +0200 build: fix syntax-check diff --git a/ftpd/ftpcmd.y b/ftpd/ftpcmd.y index 440a4e2..f242139 100644 --- a/ftpd/ftpcmd.y +++ b/ftpd/ftpcmd.y @@ -1389,7 +1389,7 @@ static struct tab cmdtab[] = { { "ADAT", ADAT, OSTR, 0, " security-data" }, { "AUTH", AUTH, OSTR, 0, " mechanism" }, { "CCC", CCC, ARGS, 0, "(clear command channel)" }, - { "CONF", CONF, OSTR, 0, " confidential-msg" }, + { "CONF", CONF, OSTR, 0, " confidential-msg" }, { "ENC", ENC, OSTR, 0, " private-message" }, { "MIC", MIC, OSTR, 0, " safe-message" }, { "PBSZ", PBSZ, OSTR, 0, " buf-size" }, ----------------------------------------------------------------------- Summary of changes: ftpd/ftpcmd.y | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Thu Jul 17 17:24:12 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1X7t9w-000816-Oe for mharc-commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:24:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7t9u-000810-0n for commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7t9s-0008Ov-IA for commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:24:09 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:34692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7t9s-0008Op-EX for commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:24:08 -0400 Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1X7t9r-0001Ui-Cc for commit-inetutils@gnu.org; Thu, 17 Jul 2014 21:24:07 +0000 Date: Thu, 17 Jul 2014 21:24:07 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-24-g57c3bb4 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: abb0bed745b939efcd4a1edcb93513cff85c6100 X-Git-Newrev: 57c3bb4c9be5b0591c67db9cd7566bc82558fefd From: Mats Erik Andersson X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 21:24:11 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via 57c3bb4c9be5b0591c67db9cd7566bc82558fefd (commit) from abb0bed745b939efcd4a1edcb93513cff85c6100 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=57c3bb4c9be5b0591c67db9cd7566bc82558fefd commit 57c3bb4c9be5b0591c67db9cd7566bc82558fefd Author: Mats Erik Andersson Date: Mon Jul 14 23:07:59 2014 +0200 ftp: Hash command semantic. diff --git a/ChangeLog b/ChangeLog index 9967cf8..2311581 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/NEWS b/NEWS index ec41f5f..9fefc7e 100644 --- a/NEWS +++ b/NEWS @@ -9,12 +9,12 @@ Version 1.9.3: * ftp -The internal command `hash' accepts a suffixed letter to the -size argument, like `12k', instead of 12288. Also, the .netrc -file can be overridden by the environment variable NETRC. -Of even higher precedence is the new option `-N/--netrc'. -The access to the resulting file, whatever method, is now -denied unless it as a regular file. +The internal command `hash' accepts a suffixed letter to the size +argument, like `12k', instead of 12288. Made a minor change to the +semantics of the command itself. Also, the .netrc file can be over- +ridden by the environment variable NETRC. Of even higher precedence +is the new option `-N/--netrc'. The access to the resulting file, +whatever method, is now denied unless it is a regular file. * syslogd diff --git a/doc/inetutils.texi b/doc/inetutils.texi index 21a33b5..9b72a97 100644 --- a/doc/inetutils.texi +++ b/doc/inetutils.texi @@ -1579,11 +1579,14 @@ an already created @command{tar} or @command{cpio} archive of the subtree, then making certain that @command{ftp} uses binary mode. @item hash [@var{size}] -Toggle hash-sign (@samp{#}) printing for each data block transferred. -The size of a data block can optionally be specified. If not given, -it defaults to 1024 bytes. The size can be written with multipliers -'k', 'K', 'm', 'M', and 'g', 'G', to specify kilobytes, megabytes, -or gigabytes. +In the absence of an argument, toggle the state of hash-sign (@samp{#}) +printing after each transferred data block. +The optional argument selects the size of data blocks, +and unconditionally activates printing. +The default size is 1024 bytes. +For convenience, the size can be written with postfix multipliers +'k', 'K', 'm', 'M', and 'g', 'G', to specify kilobytes, Megabytes, +and Gigabytes, respectively. @item help [@var{command}] @itemx ? [@var{command}] diff --git a/ftp/cmds.c b/ftp/cmds.c index 471cd86..9bd2e69 100644 --- a/ftp/cmds.c +++ b/ftp/cmds.c @@ -1201,6 +1201,10 @@ settrace (int argc _GL_UNUSED_PARAMETER, char **argv _GL_UNUSED_PARAMETER) * * Parse multipliers 'k', 'K', 'm', 'M', and * 'g', 'G' to simplify the size step. + * + * With a numerical argument, hash marking is + * made active, and the step size is updated. + * Toggle state only in absence of an argument. */ void sethash (int argc _GL_UNUSED_PARAMETER, char **argv) @@ -1214,9 +1218,11 @@ sethash (int argc _GL_UNUSED_PARAMETER, char **argv) if (argv[1] != NULL) sscanf (argv[1], "%d", &hashbytes); - /* Apply a multiplier only if a numerical part exixts. */ + /* Apply a multiplier only if a numerical part exists. */ if (argv[1] && isdigit (*argv[1])) { + hash = 1; /* Enforce markers. */ + switch (*p) { case 'g': @@ -1233,12 +1239,16 @@ sethash (int argc _GL_UNUSED_PARAMETER, char **argv) if (hashbytes <= 0) hashbytes = 1024; - hash = !hash; + + if (!argv[1]) /* Toggle when argument is absent. */ + hash = !hash; + printf ("Hash mark printing %s", onoff (hash)); - code = hash; if (hash) printf (" (%d bytes/hash mark)", hashbytes); printf (".\n"); + + code = hash; } /* ----------------------------------------------------------------------- Summary of changes: ChangeLog | 9 +++++++++ NEWS | 12 ++++++------ doc/inetutils.texi | 13 ++++++++----- ftp/cmds.c | 16 +++++++++++++--- 4 files changed, 36 insertions(+), 14 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Thu Jul 17 17:33:42 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1X7tJ8-0003QD-JP for mharc-commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:33:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7tJ5-0003Q3-DZ for commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7tJ3-0004PP-Jo for commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:33:39 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:34807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7tJ3-0004PL-GL for commit-inetutils@gnu.org; Thu, 17 Jul 2014 17:33:37 -0400 Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1X7tJ2-0002bp-IX for commit-inetutils@gnu.org; Thu, 17 Jul 2014 21:33:36 +0000 Date: Thu, 17 Jul 2014 21:33:36 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-25-gfaff170 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 57c3bb4c9be5b0591c67db9cd7566bc82558fefd X-Git-Newrev: faff170bbc56b2dbf7def54d2e69dc91a1b3b66e From: Mats Erik Andersson X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 21:33:41 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via faff170bbc56b2dbf7def54d2e69dc91a1b3b66e (commit) from 57c3bb4c9be5b0591c67db9cd7566bc82558fefd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=faff170bbc56b2dbf7def54d2e69dc91a1b3b66e commit faff170bbc56b2dbf7def54d2e69dc91a1b3b66e Author: Mats Erik Andersson Date: Thu Jul 17 23:27:08 2014 +0200 Handle access times in sub-seconds. Use contemporary and resonably portable techniques for microsecond or better accuracy in `struct stat'. diff --git a/ChangeLog b/ChangeLog index 2311581..8d11784 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +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. diff --git a/configure.ac b/configure.ac index 54fab00..135bff0 100644 --- a/configure.ac +++ b/configure.ac @@ -703,7 +703,15 @@ IU_CHECK_MEMBERS([struct sockaddr.sa_len], , , #include ]) IU_CHECK_MEMBERS([struct hostent.h_addr_list], , , [#include ]) -IU_CHECK_MEMBERS([struct stat.st_blksize]) +IU_CHECK_MEMBERS([struct stat.st_atim.tv_nsec, + struct stat.st_atim.tv_usec, + struct stat.st_blksize, + struct stat.st_ctim.tv_nsec, + struct stat.st_ctim.tv_usec, + struct stat.st_mtim.tv_nsec, + struct stat.st_mtim.tv_usec], , , + [#include + #include ]) # OpenSolaris does not use a union for `struct tftphdr.th_u'. As a # consequence `struct tftphdr.th_stuff' is a macro resolving to a diff --git a/libls/cmp.c b/libls/cmp.c index 80a6221..b3ff505 100644 --- a/libls/cmp.c +++ b/libls/cmp.c @@ -74,9 +74,39 @@ revnamecmp (const FTSENT *a, const FTSENT *b) int modcmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_mtime > a->fts_statp->st_mtime) + if (b->fts_statp->st_mtime > a->fts_statp->st_mtime + || +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + ( b->fts_statp->st_mtime == a->fts_statp->st_mtime + && + b->fts_statp->st_mtim.tv_nsec > a->fts_statp->st_mtim.tv_nsec + ) +#elif defined HAVE_STRUCT_STAT_ST_MTIM_TV_USEC + ( b->fts_statp->st_mtime == a->fts_statp->st_mtime + && + b->fts_statp->st_mtim.tv_usec > a->fts_statp->st_mtim.tv_usec + ) +#else + 0 +#endif + ) return (1); - else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime) + else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime + || +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + ( b->fts_statp->st_mtime == a->fts_statp->st_mtime + && + b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec + ) +#elif defined HAVE_STRUCT_STAT_ST_MTIM_TV_USEC + ( b->fts_statp->st_mtime == a->fts_statp->st_mtime + && + b->fts_statp->st_mtim.tv_usec < a->fts_statp->st_mtim.tv_usec + ) +#else + 0 +#endif + ) return (-1); else return (namecmp (a, b)); @@ -85,20 +115,45 @@ modcmp (const FTSENT *a, const FTSENT *b) int revmodcmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_mtime > a->fts_statp->st_mtime) - return (-1); - else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime) - return (1); - else - return (revnamecmp (a, b)); + return (- modcmp (a, b)); } int acccmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_atime > a->fts_statp->st_atime) + if (b->fts_statp->st_atime > a->fts_statp->st_atime + || +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + ( b->fts_statp->st_atime == a->fts_statp->st_atime + && + b->fts_statp->st_atim.tv_nsec > a->fts_statp->st_atim.tv_nsec + ) +#elif defined HAVE_STRUCT_STAT_ST_ATIM_TV_USEC + ( b->fts_statp->st_atime == a->fts_statp->st_atime + && + b->fts_statp->st_atim.tv_usec > a->fts_statp->st_atim.tv_usec + ) +#else + 0 +#endif + ) return (1); - else if (b->fts_statp->st_atime < a->fts_statp->st_atime) + else if (b->fts_statp->st_atime < a->fts_statp->st_atime + || +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + ( b->fts_statp->st_atime == a->fts_statp->st_atime + && + b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec + ) +#elif defined HAVE_STRUCT_STAT_ST_ATIM_TV_USEC + ( b->fts_statp->st_atime == a->fts_statp->st_atime + && + b->fts_statp->st_atim.tv_usec < a->fts_statp->st_atim.tv_usec + ) +#else + 0 +#endif + ) return (-1); else return (namecmp (a, b)); @@ -107,20 +162,45 @@ acccmp (const FTSENT *a, const FTSENT *b) int revacccmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_atime > a->fts_statp->st_atime) - return (-1); - else if (b->fts_statp->st_atime < a->fts_statp->st_atime) - return (1); - else - return (revnamecmp (a, b)); + return (- acccmp (a, b)); } int statcmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_ctime > a->fts_statp->st_ctime) + if (b->fts_statp->st_ctime > a->fts_statp->st_ctime + || +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + ( b->fts_statp->st_ctime == a->fts_statp->st_ctime + && + b->fts_statp->st_ctim.tv_nsec > a->fts_statp->st_ctim.tv_nsec + ) +#elif defined HAVE_STRUCT_STAT_ST_CTIM_TV_USEC + ( b->fts_statp->st_ctime == a->fts_statp->st_ctime + && + b->fts_statp->st_ctim.tv_usec > a->fts_statp->st_ctim.tv_usec + ) +#else + 0 +#endif + ) return (1); - else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime) + else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime + || +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + ( b->fts_statp->st_ctime == a->fts_statp->st_ctime + && + b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec + ) +#elif defined HAVE_STRUCT_STAT_ST_CTIM_TV_USEC + ( b->fts_statp->st_ctime == a->fts_statp->st_ctime + && + b->fts_statp->st_ctim.tv_usec < a->fts_statp->st_ctim.tv_usec + ) +#else + 0 +#endif + ) return (-1); else return (namecmp (a, b)); @@ -129,12 +209,7 @@ statcmp (const FTSENT *a, const FTSENT *b) int revstatcmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_ctime > a->fts_statp->st_ctime) - return (-1); - else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime) - return (1); - else - return (revnamecmp (a, b)); + return (- statcmp (a, b)); } int @@ -151,10 +226,5 @@ sizecmp (const FTSENT *a, const FTSENT *b) int revsizecmp (const FTSENT *a, const FTSENT *b) { - if (b->fts_statp->st_size > a->fts_statp->st_size) - return (-1); - if (b->fts_statp->st_size < a->fts_statp->st_size) - return (1); - else - return (revnamecmp (a, b)); + return (- sizecmp (a, b)); } diff --git a/src/rcp.c b/src/rcp.c index 234beac..d59c11f 100644 --- a/src/rcp.c +++ b/src/rcp.c @@ -677,18 +677,18 @@ write_stat_time (int fd, struct stat *stat) time_t a_sec, m_sec; long a_usec = 0, m_usec = 0; -#ifdef HAVE_STAT_ST_MTIMESPEC - a_sec = stat->st_atimespec.ts_sec; - a_usec = stat->st_atimespec.ts_nsec / 1000; - m_sec = stat->st_mtimespec.ts_sec; - m_usec = stat->st_mtimespec.ts_nsec / 1000; -#else a_sec = stat->st_atime; +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + a_usec = stat->st_atim.tv_nsec / 1000; +#elif defined HAVE_STRUCT_STAT_ST_ATIM_TV_USEC + a_usec = stat->st_atim.tv_usec; +#endif + m_sec = stat->st_mtime; -# ifdef HAVE_STAT_ST_MTIME_USEC - a_usec = stat->st_atime_usec; - m_usec = stat->st_mtime_usec; -# endif +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + m_usec = stat->st_mtim.tv_nsec / 1000; +#elif defined HAVE_STRUCT_STAT_ST_MTIM_TV_USEC + m_usec = stat->st_mtim.tv_usec; #endif snprintf (buf, sizeof (buf), "T%ld %ld %ld %ld\n", ----------------------------------------------------------------------- Summary of changes: ChangeLog | 26 ++++++++++++ configure.ac | 10 ++++- libls/cmp.c | 130 ++++++++++++++++++++++++++++++++++++++++++++------------- src/rcp.c | 20 ++++---- 4 files changed, 145 insertions(+), 41 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Thu Jul 17 18:56:27 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1X7ubD-0001xa-LD for mharc-commit-inetutils@gnu.org; Thu, 17 Jul 2014 18:56:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7ubB-0001uz-4N for commit-inetutils@gnu.org; Thu, 17 Jul 2014 18:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7ub9-00046K-CI for commit-inetutils@gnu.org; Thu, 17 Jul 2014 18:56:25 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:35387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7ub9-00045y-7c for commit-inetutils@gnu.org; Thu, 17 Jul 2014 18:56:23 -0400 Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1X7ub7-0000yw-PI for commit-inetutils@gnu.org; Thu, 17 Jul 2014 22:56:22 +0000 Date: Thu, 17 Jul 2014 22:56:21 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-26-g8c7a55e X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: faff170bbc56b2dbf7def54d2e69dc91a1b3b66e X-Git-Newrev: 8c7a55e6eb1b2d18561e4669e0a7b5a4aa8219ac From: Mats Erik Andersson X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 22:56:27 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via 8c7a55e6eb1b2d18561e4669e0a7b5a4aa8219ac (commit) from faff170bbc56b2dbf7def54d2e69dc91a1b3b66e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=8c7a55e6eb1b2d18561e4669e0a7b5a4aa8219ac commit 8c7a55e6eb1b2d18561e4669e0a7b5a4aa8219ac Author: Mats Erik Andersson Date: Thu Jul 17 23:45:05 2014 +0200 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. diff --git a/ChangeLog b/ChangeLog index 8d11784..926c36e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +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. diff --git a/ftp/ftp.c b/ftp/ftp.c index 17ddd28..d117974 100644 --- a/ftp/ftp.c +++ b/ftp/ftp.c @@ -169,9 +169,14 @@ hookup (char *host, int port) free (rhost); return ((char *) 0); } - free (rhost); - strncpy (hostnamebuf, res->ai_canonname, sizeof (hostnamebuf)); + + if (res->ai_canonname) + strncpy (hostnamebuf, res->ai_canonname, sizeof (hostnamebuf)); + else + strncpy (hostnamebuf, rhost, sizeof (hostnamebuf)); + hostname = hostnamebuf; + free (rhost); for (ai = res; ai != NULL; ai = ai->ai_next, ++again) { diff --git a/ping/libping.c b/ping/libping.c index 01c8c7e..474cc68 100644 --- a/ping/libping.c +++ b/ping/libping.c @@ -291,15 +291,19 @@ ping_set_dest (PING * ping, char *host) # endif rc = getaddrinfo (p, NULL, &hints, &res); -# ifdef HAVE_IDN - free (p); -# endif if (rc) return 1; memcpy (&ping->ping_dest.ping_sockaddr, res->ai_addr, res->ai_addrlen); - ping->ping_hostname = strdup (res->ai_canonname); + if (res->ai_canonname) + ping->ping_hostname = strdup (res->ai_canonname); + else + ping->ping_hostname = strdup (p); + +# ifdef HAVE_IDN + free (p); +# endif freeaddrinfo (res); return 0; diff --git a/ping/ping6.c b/ping/ping6.c index cada992..a998d2b 100644 --- a/ping/ping6.c +++ b/ping/ping6.c @@ -1020,15 +1020,19 @@ ping_set_dest (PING * ping, char *host) #endif err = getaddrinfo (rhost, NULL, &hints, &result); -#if HAVE_IDN - free (rhost); -#endif if (err) return 1; memcpy (&ping->ping_dest.ping_sockaddr6, result->ai_addr, result->ai_addrlen); - ping->ping_hostname = strdup (result->ai_canonname); + if (result->ai_canonname) + ping->ping_hostname = strdup (result->ai_canonname); + else + ping->ping_hostname = strdup (rhost); + +#if HAVE_IDN + free (rhost); +#endif freeaddrinfo (result); if (!ping->ping_hostname) diff --git a/src/traceroute.c b/src/traceroute.c index 81f4c6e..0410182 100644 --- a/src/traceroute.c +++ b/src/traceroute.c @@ -312,7 +312,6 @@ main (int argc, char **argv) #endif rc = getaddrinfo (rhost, NULL, &hints, &res); - free (rhost); if (rc) error (EXIT_FAILURE, 0, "unknown host"); @@ -321,11 +320,13 @@ main (int argc, char **argv) dest.sin_port = htons (opt_port); getnameinfo (res->ai_addr, res->ai_addrlen, addrstr, sizeof (addrstr), - NULL, 0, NI_NUMERICHOST); + NULL, 0, NI_NUMERICHOST); printf ("traceroute to %s (%s), %d hops max\n", - res->ai_canonname, addrstr, opt_max_hops); + res->ai_canonname ? res->ai_canonname : rhost, + addrstr, opt_max_hops); + free (rhost); freeaddrinfo (res); trace_ip_opts (&dest); @@ -398,7 +399,7 @@ do_try (trace_t * trace, const int hop, /* was interrupted */ break; default: - error (EXIT_FAILURE, errno, "select failed"); + error (EXIT_FAILURE, errno, "select failed"); break; } } @@ -494,16 +495,16 @@ trace_init (trace_t * t, const struct sockaddr_in to, { t->icmpfd = socket (PF_INET, SOCK_RAW, protocol->p_proto); if (t->icmpfd < 0) - error (EXIT_FAILURE, errno, "socket"); + error (EXIT_FAILURE, errno, "socket"); if (setsockopt (t->icmpfd, IPPROTO_IP, IP_TTL, ttlp, sizeof (*ttlp)) < 0) - error (EXIT_FAILURE, errno, "setsockopt"); + error (EXIT_FAILURE, errno, "setsockopt"); } else { /* FIXME: Should we error out? */ - error (EXIT_FAILURE, 0, "can't find supplied protocol 'icmp'"); + error (EXIT_FAILURE, 0, "can't find supplied protocol 'icmp'"); } /* free (protocol); ??? */ @@ -672,12 +673,12 @@ trace_write (trace_t * t) case ECONNRESET: break; default: - error (EXIT_FAILURE, errno, "sendto"); + error (EXIT_FAILURE, errno, "sendto"); } } if (gettimeofday (&t->tsent, NULL) < 0) - error (EXIT_FAILURE, errno, "gettimeofday"); + error (EXIT_FAILURE, errno, "gettimeofday"); } break; @@ -699,12 +700,12 @@ trace_write (trace_t * t) case ECONNRESET: break; default: - error (EXIT_FAILURE, errno, "sendto"); + error (EXIT_FAILURE, errno, "sendto"); } } if (gettimeofday (&t->tsent, NULL) < 0) - error (EXIT_FAILURE, errno, "gettimeofday"); + error (EXIT_FAILURE, errno, "gettimeofday"); } break; ----------------------------------------------------------------------- Summary of changes: ChangeLog | 12 ++++++++++++ ftp/ftp.c | 9 +++++++-- ping/libping.c | 12 ++++++++---- ping/ping6.c | 12 ++++++++---- src/traceroute.c | 23 ++++++++++++----------- 5 files changed, 47 insertions(+), 21 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Fri Jul 25 10:48:29 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XAgnN-0000va-U9 for mharc-commit-inetutils@gnu.org; Fri, 25 Jul 2014 10:48:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAgnK-0000u1-0N for commit-inetutils@gnu.org; Fri, 25 Jul 2014 10:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAgnI-0002CN-15 for commit-inetutils@gnu.org; Fri, 25 Jul 2014 10:48:25 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:33259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAgnH-0002C4-SY for commit-inetutils@gnu.org; Fri, 25 Jul 2014 10:48:23 -0400 Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1XAgnG-00069F-1w for commit-inetutils@gnu.org; Fri, 25 Jul 2014 14:48:22 +0000 Date: Fri, 25 Jul 2014 14:48:22 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-27-g139c199 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8c7a55e6eb1b2d18561e4669e0a7b5a4aa8219ac X-Git-Newrev: 139c19958e5f069ff802bfa580832e52d4aeb357 From: Mats Erik Andersson X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2014 14:48:27 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via 139c19958e5f069ff802bfa580832e52d4aeb357 (commit) from 8c7a55e6eb1b2d18561e4669e0a7b5a4aa8219ac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=139c19958e5f069ff802bfa580832e52d4aeb357 commit 139c19958e5f069ff802bfa580832e52d4aeb357 Author: Mats Erik Andersson Date: Tue Jul 22 20:42:22 2014 +0200 libls: Inconsistent options. diff --git a/ChangeLog b/ChangeLog index 926c36e..49916f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +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. diff --git a/configure.ac b/configure.ac index 135bff0..e1e4b08 100644 --- a/configure.ac +++ b/configure.ac @@ -220,9 +220,12 @@ if test "$enable_libls" = yes && test "$ac_cv_func_fchdir" = yes ; then else LIBLS='' libls_BUILD='' + enable_libls='no' fi AC_SUBST(LIBLS) AC_SUBST(libls_BUILD) +AC_SUBST(enable_libls) +AM_CONDITIONAL([ENABLE_libls], test "$enable_libls" = yes) # At least OpenSolaris is missing . AC_CHECK_HEADER(protocols/talkd.h, , , diff --git a/libls/fts.h b/libls/fts.h index 0678789..a7179b5 100644 --- a/libls/fts.h +++ b/libls/fts.h @@ -92,8 +92,8 @@ typedef struct _ftsent char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ - unsigned short fts_pathlen; /* strlen(fts_path) */ - unsigned short fts_namelen; /* strlen(fts_name) */ + unsigned short fts_pathlen; /* strlen(fts_path) */ + unsigned short fts_namelen; /* strlen(fts_name) */ ino_t fts_ino; /* inode */ dev_t fts_dev; /* device */ @@ -106,10 +106,10 @@ typedef struct _ftsent # define FTS_D 1 /* preorder directory */ # define FTS_DC 2 /* directory that causes cycles */ # define FTS_DEFAULT 3 /* none of the above */ -# define FTS_DNR 4 /* unreadable directory */ -# define FTS_DOT 5 /* dot or dot-dot */ +# define FTS_DNR 4 /* unreadable directory */ +# define FTS_DOT 5 /* dot or dot-dot */ # define FTS_DP 6 /* postorder directory */ -# define FTS_ERR 7 /* error; errno is set */ +# define FTS_ERR 7 /* error; errno is set */ # define FTS_F 8 /* regular file */ # define FTS_INIT 9 /* initialized only */ # define FTS_NS 10 /* stat(2) failed */ @@ -117,17 +117,17 @@ typedef struct _ftsent # define FTS_SL 12 /* symbolic link */ # define FTS_SLNONE 13 /* symbolic link without target */ # define FTS_W 14 /* whiteout object */ - unsigned short fts_info; /* user flags for FTSENT structure */ + unsigned short fts_info; /* user flags for FTSENT structure */ # define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ # define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ - unsigned short fts_flags; /* private flags for FTSENT structure */ + unsigned short fts_flags; /* private flags for FTSENT structure */ # define FTS_AGAIN 1 /* read node again */ # define FTS_FOLLOW 2 /* follow symbolic link */ # define FTS_NOINSTR 3 /* no instructions */ # define FTS_SKIP 4 /* discard node */ - unsigned short fts_instr; /* fts_set() instructions */ + unsigned short fts_instr; /* fts_set() instructions */ struct stat *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ diff --git a/libls/ls.c b/libls/ls.c index e837cd2..229f398 100644 --- a/libls/ls.c +++ b/libls/ls.c @@ -160,7 +160,7 @@ ls_main (int argc, char **argv) switch (ch) { /* - * The -1, -C and -l, -m and -x options all override each + * The options -1, -C, -l, -m, -n and -x all overrule each * other so shell aliasing works right. */ case '1': @@ -173,12 +173,12 @@ ls_main (int argc, char **argv) break; case 'l': f_longform = 1; + f_numericonly = 0; f_column = f_columnacross = f_singlecol = f_stream = 0; break; case 'm': f_stream = 1; - f_column = f_columnacross = f_singlecol = 0; - f_singlecol = 0; + f_column = f_columnacross = f_longform = f_singlecol = 0; break; case 'x': f_columnacross = 1; @@ -187,7 +187,7 @@ ls_main (int argc, char **argv) case 'n': f_longform = 1; f_numericonly = 1; - f_column = f_singlecol = 0; + f_column = f_columnacross = f_singlecol = f_stream = 0; break; /* The -c and -u options override each other. */ case 'c': diff --git a/summary.sh.in b/summary.sh.in index fd30315..1bda7a7 100644 --- a/summary.sh.in +++ b/summary.sh.in @@ -32,6 +32,9 @@ enable_ifconfig=@enable_ifconfig@ ifconfig_BUILD=@ifconfig_BUILD@ ifconfig_PROPS="@ifconfig_PROPS@" enable_logger=@enable_logger@ +libls_BUILD=@libls_BUILD@ +libls_PROPS="@libls_PROPS@" +enable_libls=@enable_libls@ logger_BUILD=@logger_BUILD@ logger_PROPS="@logger_PROPS@" enable_ping=@enable_ping@ @@ -134,4 +137,8 @@ ${traceroute_BUILD:+ $traceroute_PROPS} telnetd ${enable_telnetd}${telnetd_BUILD:+ $telnetd_PROPS} tftpd ${enable_tftpd} uucpd ${enable_uucpd} + + Support: + + libls ${enable_libls} EOT diff --git a/tests/Makefile.am b/tests/Makefile.am index 7ab0e53..014af85 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,11 @@ if ENABLE_inetd check_PROGRAMS += addrpeek tcpget endif +if ENABLE_libls +noinst_PROGRAMS += ls +ls_LDADD = $(LIBLS) $(iu_LIBRARIES) +endif + dist_check_SCRIPTS = utmp.sh if ENABLE_ping dist_check_SCRIPTS += ping-localhost.sh diff --git a/tests/ls.c b/tests/ls.c new file mode 100644 index 0000000..d6e2766 --- /dev/null +++ b/tests/ls.c @@ -0,0 +1,27 @@ +/* ls - program buildable from libls + Copyright (C) 2014 Free Software Foundation, Inc. + + This file is part of GNU Inetutils. + + GNU Inetutils is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + GNU Inetutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see `http://www.gnu.org/licenses/'. */ + +#include "config.h" + +extern int ls_main (int, char **); + +int +main (int argc, char *argv[]) +{ + return ls_main(argc, argv); +} ----------------------------------------------------------------------- Summary of changes: ChangeLog | 21 +++++++++++++++++++++ configure.ac | 3 +++ libls/fts.h | 16 ++++++++-------- libls/ls.c | 8 ++++---- summary.sh.in | 7 +++++++ tests/Makefile.am | 5 +++++ libtelnet/genget.h => tests/ls.c | 17 +++++++++++------ 7 files changed, 59 insertions(+), 18 deletions(-) copy libtelnet/genget.h => tests/ls.c (75%) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Sat Jul 26 11:10:59 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XB3ch-0005JD-9A for mharc-commit-inetutils@gnu.org; Sat, 26 Jul 2014 11:10:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XB3ce-0005IS-1T for commit-inetutils@gnu.org; Sat, 26 Jul 2014 11:10:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XB3cc-0007Yk-Db for commit-inetutils@gnu.org; Sat, 26 Jul 2014 11:10:55 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:45557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XB3cc-0007Ye-9x for commit-inetutils@gnu.org; Sat, 26 Jul 2014 11:10:54 -0400 Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1XB3cb-0002FI-Eg for commit-inetutils@gnu.org; Sat, 26 Jul 2014 15:10:53 +0000 Date: Sat, 26 Jul 2014 15:10:53 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-28-g8bcfbba X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 139c19958e5f069ff802bfa580832e52d4aeb357 X-Git-Newrev: 8bcfbba0d8bae00de9e5945fad62ce4bec9110c8 From: Mats Erik Andersson X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jul 2014 15:10:57 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via 8bcfbba0d8bae00de9e5945fad62ce4bec9110c8 (commit) from 139c19958e5f069ff802bfa580832e52d4aeb357 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=8bcfbba0d8bae00de9e5945fad62ce4bec9110c8 commit 8bcfbba0d8bae00de9e5945fad62ce4bec9110c8 Author: Mats Erik Andersson Date: Sat Jul 26 16:51:00 2014 +0200 whois: Cooperate with misbehaving servers. When the socket is half-closed by the client, then some remote servers abort connection without a complete reply. The cause was located and reported by Alexander Zubkov. diff --git a/ChangeLog b/ChangeLog index 49916f7..1b41b11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +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. diff --git a/doc/inetutils.texi b/doc/inetutils.texi index 9b72a97..81fd9ff 100644 --- a/doc/inetutils.texi +++ b/doc/inetutils.texi @@ -1286,6 +1286,34 @@ Verbosely explain all actions taken. Search only for exact matches. Applicable only to RPSL. @end table + +@section Environment variables +@anchor{whois environment} + +@command{whois} holds an internal list of information servers +and their assigned data bases. +Queries are examined against this list to select the most +plausible server, but the hint can always be overruled on +the command line by use of the option @option{-h}. +If neither of these have a say, then the default server to ask +is @samp{whois.internic.net}, but this name is in turn overruled +by a server name in the environment variable @env{WHOIS_SERVER}. + +@table @env +@item LANG +When the server @samp{whois.nic.ad.jp} is queried, and only then, +any non-Japanese locale in @env{LANG} will ask the server to reply +with English text, not Japanese. + +@item WHOIS_HIDE +When set, the effect on @command{whois} is as if the +option @option{-H} had been given. + +@item WHOIS_SERVER +Data base server to query when internal hinting is inconclusive. +When unset, @samp{whois.internic.net} is used as default server. + +@end table @node ftp invocation diff --git a/whois/whois.c b/whois/whois.c index ec720b0..386ea8e 100644 --- a/whois/whois.c +++ b/whois/whois.c @@ -126,7 +126,8 @@ static struct argp ripe_argp = { ripe_argp_options, ripe_argp_parser, NULL, NULL, NULL, NULL, NULL }; static struct argp_option gwhois_argp_options[] = { -#define GRP 10 +#define GRP 20 + { NULL, 0, NULL, 0, "General options", GRP }, { "verbose", 'V', NULL, 0, "explain what is being done", GRP }, { "server", 'h', "HOST", 0, @@ -470,8 +471,7 @@ do_query (const int sock, const char *query) fi = fdopen (sock, "r"); if (write (sock, query, strlen (query)) < 0) err_sys ("write"); - if (shutdown (sock, 1) < 0) - err_sys ("shutdown"); + while (fgets (buf, 200, fi)) { /* XXX errors? */ if (hide == 1) @@ -541,6 +541,7 @@ query_crsnic (const int sock, const char *query) fi = fdopen (sock, "r"); if (write (sock, temp, strlen (temp)) < 0) err_sys ("write"); + while (fgets (buf, 100, fi)) { /* If there are multiple matches only the server of the first record ----------------------------------------------------------------------- Summary of changes: ChangeLog | 17 +++++++++++++++++ doc/inetutils.texi | 28 ++++++++++++++++++++++++++++ whois/whois.c | 7 ++++--- 3 files changed, 49 insertions(+), 3 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Mon Jul 28 04:01:41 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XBfsL-0005Ci-FO for mharc-commit-inetutils@gnu.org; Mon, 28 Jul 2014 04:01:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBfsJ-0005CY-3w for commit-inetutils@gnu.org; Mon, 28 Jul 2014 04:01:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBfsH-0004P4-V5 for commit-inetutils@gnu.org; Mon, 28 Jul 2014 04:01:39 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:38240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBfsH-0004OR-Rr for commit-inetutils@gnu.org; Mon, 28 Jul 2014 04:01:37 -0400 Received: from gscrivano by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1XBfsF-0002lf-Se for commit-inetutils@gnu.org; Mon, 28 Jul 2014 08:01:37 +0000 Date: Mon, 28 Jul 2014 08:01:35 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-29-ga60088c X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8bcfbba0d8bae00de9e5945fad62ce4bec9110c8 X-Git-Newrev: a60088c32b9e0782bc4bda3807b9b79efa0b3df0 From: Giuseppe Scrivano X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2014 08:01:40 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via a60088c32b9e0782bc4bda3807b9b79efa0b3df0 (commit) from 8bcfbba0d8bae00de9e5945fad62ce4bec9110c8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=a60088c32b9e0782bc4bda3807b9b79efa0b3df0 commit a60088c32b9e0782bc4bda3807b9b79efa0b3df0 Author: Giuseppe Scrivano Date: Mon Jul 28 10:00:22 2014 +0200 Fix sc_require_config_h diff --git a/ChangeLog b/ChangeLog index 1b41b11..d12fbc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-07-28 Giuseppe Scrivano + + * tests/ls.c: Include not "config.h". + 2014-07-26 Mats Erik Andersson whois: Cooperate with misbehaving servers. diff --git a/tests/ls.c b/tests/ls.c index d6e2766..c576ef4 100644 --- a/tests/ls.c +++ b/tests/ls.c @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see `http://www.gnu.org/licenses/'. */ -#include "config.h" +#include extern int ls_main (int, char **); ----------------------------------------------------------------------- Summary of changes: ChangeLog | 4 ++++ tests/ls.c | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Wed Jul 30 12:18:49 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XCWaX-00060Q-2g for mharc-commit-inetutils@gnu.org; Wed, 30 Jul 2014 12:18:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWaT-0005xI-PT for commit-inetutils@gnu.org; Wed, 30 Jul 2014 12:18:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCWaO-00086Y-Vs for commit-inetutils@gnu.org; Wed, 30 Jul 2014 12:18:45 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:38128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWaO-00086U-Ro for commit-inetutils@gnu.org; Wed, 30 Jul 2014 12:18:40 -0400 Received: from ams by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1XCWaN-0005XZ-OI for commit-inetutils@gnu.org; Wed, 30 Jul 2014 16:18:40 +0000 Date: Wed, 30 Jul 2014 16:18:39 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-31-gd129f72 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a60088c32b9e0782bc4bda3807b9b79efa0b3df0 X-Git-Newrev: d129f72ed5de3557b27152965a4a0b6d597ba653 From: "Alfred M. Szmidt" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 16:18:47 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via d129f72ed5de3557b27152965a4a0b6d597ba653 (commit) via e5d2fade3ae0be1a3969df933e677e1044d22b73 (commit) from a60088c32b9e0782bc4bda3807b9b79efa0b3df0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=d129f72ed5de3557b27152965a4a0b6d597ba653 commit d129f72ed5de3557b27152965a4a0b6d597ba653 Author: Alfred M. Szmidt Date: Wed Jul 30 18:18:12 2014 +0200 * telnetd/utility.c (printsub): Don't add integer to string to try and skip quote. diff --git a/ChangeLog b/ChangeLog index 8b6943c..d293e10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * 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". diff --git a/telnetd/utility.c b/telnetd/utility.c index 992b6a1..6c7c455 100644 --- a/telnetd/utility.c +++ b/telnetd/utility.c @@ -1356,50 +1356,50 @@ printsub (int direction, unsigned char *pointer, int length) env_common: { - int noquote = 2; + char *quote = ""; for (i = 2; i < length; i++) { switch (pointer[i]) { case NEW_ENV_VAR: - debug_output_data ("\" VAR " + noquote); - noquote = 2; + debug_output_data ("%sVAR ", quote); + quote = ""; break; case NEW_ENV_VALUE: - debug_output_data ("\" VALUE " + noquote); - noquote = 2; + debug_output_data ("%sVALUE ", quote); + quote = ""; break; case ENV_ESC: - debug_output_data ("\" ESC " + noquote); - noquote = 2; + debug_output_data ("%sESC ", quote); + quote = ""; break; case ENV_USERVAR: - debug_output_data ("\" USERVAR " + noquote); - noquote = 2; + debug_output_data ("%sUSERVAR ", quote); + quote = ""; break; default: if (isprint (pointer[i]) && pointer[i] != '"') { - if (noquote) + if (strcmp (quote, "") == 0) { debug_output_data ("\""); - noquote = 0; + quote = "\" "; } debug_output_datalen ((char*) &pointer[i], 1); } else { - debug_output_data ("\" %03o " + noquote, pointer[i]); - noquote = 2; + debug_output_data ("%s%03o ", quote, pointer[i]); + quote = ""; } break; } } - if (!noquote) + if (strcmp (quote, "\" ") == 0) debug_output_data ("\""); break; } http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=e5d2fade3ae0be1a3969df933e677e1044d22b73 commit e5d2fade3ae0be1a3969df933e677e1044d22b73 Author: Alfred M. Szmidt Date: Wed Jul 30 18:14:25 2014 +0200 * telnetd/utility.c (nextitem, netclear, printoption, printsub) (printdata): Remove register keyword usage. diff --git a/ChangeLog b/ChangeLog index d12fbc4..8b6943c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-07-30 Alfred M. Szmidt + + * telnetd/utility.c (nextitem, netclear, printoption, printsub) + (printdata): Remove register keyword usage. + 2014-07-28 Giuseppe Scrivano * tests/ls.c: Include not "config.h". diff --git a/telnetd/utility.c b/telnetd/utility.c index e38cf1d..992b6a1 100644 --- a/telnetd/utility.c +++ b/telnetd/utility.c @@ -44,8 +44,8 @@ # include #endif -#if defined HAVE_STREAMSPTY && defined HAVE_GETMSG \ - && defined HAVE_STROPTS_H +#if defined HAVE_STREAMSPTY && defined HAVE_GETMSG \ + && defined HAVE_STROPTS_H # include #endif @@ -491,13 +491,13 @@ nextitem (char *current) case SB: /* loop forever looking for the SE */ { - register char *look = current + 2; + char *look = current + 2; for (;;) if ((*look++ & 0xff) == IAC && (*look++ & 0xff) == SE) return look; - default: + default: return current + 2; } } @@ -520,15 +520,15 @@ nextitem (char *current) * caller should be setting the urgent data pointer AFTER calling * us in any case. */ -#define wewant(p) \ - ((nfrontp > p) && ((*p&0xff) == IAC) && \ +#define wewant(p) \ + ((nfrontp > p) && ((*p&0xff) == IAC) && \ ((*(p+1)&0xff) != EC) && ((*(p+1)&0xff) != EL)) void netclear (void) { - register char *thisitem, *next; + char *thisitem, *next; char *good; #ifdef ENCRYPTION @@ -662,7 +662,7 @@ fatal (int f, char *msg) #endif /* ENCRYPTION */ write (f, buf, (int) strlen (buf)); sleep (1); - /*FIXME*/ exit (EXIT_FAILURE); + /*FIXME*/ exit (EXIT_FAILURE); } void @@ -921,7 +921,7 @@ debug_output_data (const char *fmt, ...) * Print telnet options and commands in plain text, if possible. */ void -printoption (register char *fmt, register int option) +printoption (char *fmt, int option) { if (TELOPT_OK (option)) debug_output_data ("%s %s\r\n", fmt, TELOPT (option)); @@ -937,7 +937,7 @@ printoption (register char *fmt, register int option) void printsub (int direction, unsigned char *pointer, int length) { - register int i = 0; + int i = 0; #if defined AUTHENTICATION || defined ENCRYPTION char buf[512]; @@ -957,7 +957,7 @@ printsub (int direction, unsigned char *pointer, int length) direction == '<' ? "recv" : "send"); if (length >= 3) { - register int j; + int j; i = pointer[length - 2]; j = pointer[length - 1]; @@ -1231,8 +1231,8 @@ printsub (int direction, unsigned char *pointer, int length) case TELOPT_STATUS: { - register char *cp; - register int j, k; + char *cp; + int j, k; debug_output_data ("STATUS"); @@ -1356,7 +1356,7 @@ printsub (int direction, unsigned char *pointer, int length) env_common: { - register int noquote = 2; + int noquote = 2; for (i = 2; i < length; i++) { switch (pointer[i]) @@ -1571,9 +1571,9 @@ printsub (int direction, unsigned char *pointer, int length) * Dump a data buffer in hex and ascii to the output data stream. */ void -printdata (register char *tag, register char *ptr, register int cnt) +printdata (char *tag, char *ptr, int cnt) { - register int i; + int i; char xbuf[30]; while (cnt) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 7 ++++++ telnetd/utility.c | 58 ++++++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 29 deletions(-) hooks/post-receive -- GNU Inetutils From MAILER-DAEMON Thu Jul 31 18:36:51 2014 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XCyxv-0001xZ-91 for mharc-commit-inetutils@gnu.org; Thu, 31 Jul 2014 18:36:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCyxs-0001wu-5S for commit-inetutils@gnu.org; Thu, 31 Jul 2014 18:36:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCyxq-0007f6-MW for commit-inetutils@gnu.org; Thu, 31 Jul 2014 18:36:48 -0400 Received: from vcs.savannah.gnu.org ([140.186.70.72]:52834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCyxq-0007f1-J9 for commit-inetutils@gnu.org; Thu, 31 Jul 2014 18:36:46 -0400 Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1XCyxp-0003O8-Fd for commit-inetutils@gnu.org; Thu, 31 Jul 2014 22:36:45 +0000 Date: Thu, 31 Jul 2014 22:36:45 +0000 Message-Id: To: commit-inetutils@gnu.org Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-32-ge5e91cd X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d129f72ed5de3557b27152965a4a0b6d597ba653 X-Git-Newrev: e5e91cdb14b3dbb0dfd02c7f2f60b2b0abc4ff1e From: Mats Erik Andersson X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.72 X-BeenThere: commit-inetutils@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: CVS commit notices for the GNU Internet utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 22:36:49 -0000 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Inetutils ". The branch, master has been updated via e5e91cdb14b3dbb0dfd02c7f2f60b2b0abc4ff1e (commit) from d129f72ed5de3557b27152965a4a0b6d597ba653 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=e5e91cdb14b3dbb0dfd02c7f2f60b2b0abc4ff1e commit e5e91cdb14b3dbb0dfd02c7f2f60b2b0abc4ff1e Author: Mats Erik Andersson Date: Fri Aug 1 00:26:08 2014 +0200 ftp: Friendlier printing of transfer speed. diff --git a/ChangeLog b/ChangeLog index d293e10..fe50b73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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) diff --git a/ftp/ftp.c b/ftp/ftp.c index d117974..66afeea 100644 --- a/ftp/ftp.c +++ b/ftp/ftp.c @@ -1583,8 +1583,7 @@ ptransfer (char *direction, long long int bytes, struct timeval *t0, struct timeval *t1) { struct timeval td; - float s; - long long bs; + float s, bs; if (verbose) { @@ -1592,8 +1591,15 @@ ptransfer (char *direction, long long int bytes, s = td.tv_sec + (td.tv_usec / 1000000.); #define nz(x) ((x) == 0 ? 1 : (x)) bs = bytes / nz (s); - printf ("%lld bytes %s in %.3g seconds (%lld bytes/s)\n", - bytes, direction, s, bs); + + printf ("%lld bytes %s in %.3g seconds", bytes, direction, s); + + if (bs > 1048576.0) + printf (" (%.3g Mbytes/s)\n", bs / 1048576.0); + else if (bs > 1024.0) + printf (" (%.3g kbytes/s)\n", bs / 1024.0); + else + printf (" (%.3g bytes/s)\n", bs); } } ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 ++++++ ftp/ftp.c | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) hooks/post-receive -- GNU Inetutils