commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-204-g3299b


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-204-g3299ba8
Date: Wed, 14 Nov 2012 22:02:21 +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  3299ba83d9bac4ea2dae81cb6adcc5d04187f79f (commit)
      from  cd22e53cf78c9fd317d2b25296ebf0235c3d4644 (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=3299ba83d9bac4ea2dae81cb6adcc5d04187f79f


commit 3299ba83d9bac4ea2dae81cb6adcc5d04187f79f
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Nov 14 13:24:12 2012 +0100

    Mixed testing issues.

diff --git a/ChangeLog b/ChangeLog
index 798fea6..4b9bb6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2012-11-14  Mats Erik Andersson  <address@hidden>
+
+       * libinetutils/daemon.c (waitdaemon) [_SC_OPEN_MAX]:
+       Remove HAVE_SYSCONF from preprocessor conditional.
+
+       * src/syslogd.c (main): Install `die' for SIGINT, SIGQUIT,
+       and SIGUSR1 based on NoDetach.  Initially set `dpg_output = 1'
+       only in debug mode.  Print a notice also in non-detached mode.
+       (cfline): Move assignment to `f->f_file' outside of
+       if-statement.
+       (dbg_printf): Test `!(NoDetach && dbg_output)' for output.
+
+       * tests/waitdaemon.c: New source file.
+       * tests/Makefile.am (check_PROGRAMS): Add waitdaemon.
+       (TESTS): Likewise.
+       * tests/.gitignore: Likewise.
+
+       * tests/syslogd.sh: Add a sleep period after `kill -HUP'.
+       (OBSCURE): New environment variable.  Conduct configuration
+       test for non-existent log host only if OBSCURE is set.
+
+       * tests/utmp.sh: Use who(1), if possible, to improve
+       reliability of test, checking known users only.
+       * configure.ac <*-freebsd9* || *-freebsd10*>:
+       Do not disable syslogd and talkd, as the updated test script
+       `utmp.sh' will catch the failure as long as it remains.
+
+       * src/Makefile.am (AM_CPPFLAGS): Add $(PATHDEF_TTY_PFX).
+       * talkd/Makefile.am (AM_CPPFLAGS): Likewise.
+       * telnetd/Makefile.am (AM_CPPFLAGS): Likewise.
+
+       * whois/Makefile.am: Set `LANG=C' when invoking perl.
+
 2012-11-10  Mats Erik Andersson  <address@hidden>
 
        Consistent use of device prefix.
diff --git a/configure.ac b/configure.ac
index c37b828..4ce360f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -966,8 +966,6 @@ case "$host" in
   # readutmp module from GNUlib.
   enable_ftpd=no  ftpd_BUILD=''
   enable_rlogind=no  rlogind_BUILD=''
-  enable_syslogd=no  syslogd_BUILD=''
-  enable_talkd=no  talkd_BUILD=''
   enable_telnetd=no  telnetd_BUILD=''
   enable_uucpd=no  uucpd_BUILD=''
   ;;
diff --git a/libinetutils/daemon.c b/libinetutils/daemon.c
index 1265c68..9a20442 100644
--- a/libinetutils/daemon.c
+++ b/libinetutils/daemon.c
@@ -174,7 +174,7 @@ waitdaemon (int nochdir, int noclose, int maxwait)
       int i;
       long fdlimit = -1;
 
-#if defined HAVE_SYSCONF && defined _SC_OPEN_MAX
+#if defined _SC_OPEN_MAX
       fdlimit = sysconf (_SC_OPEN_MAX);
 #elif defined (HAVE_GETDTABLESIZE)
       fdlimit = getdtablesize ();
diff --git a/src/Makefile.am b/src/Makefile.am
index 05e3aa1..7242eb4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -102,7 +102,7 @@ EXTRA_PROGRAMS += uucpd
 
 INCLUDES = $(iu_INCLUDES) $(INCAUTH) -I$(top_srcdir)/libicmp $(INCIDN)
 
-AM_CPPFLAGS = $(PATHDEF_BSHELL) $(PATHDEF_CONSOLE) $(PATHDEF_CP) 
$(PATHDEF_DEFPATH) $(PATHDEF_DEV) $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) 
$(PATHDEF_INETDPID) $(PATHDEF_KLOG) $(PATHDEF_LOG) $(PATHDEF_LOGCONF) 
$(PATHDEF_LOGIN) $(PATHDEF_LOGPID) $(PATHDEF_NOLOGIN) $(PATHDEF_RLOGIN) 
$(PATHDEF_RSH) $(PATHDEF_TTY) $(PATHDEF_UTMP) $(PATHDEF_UTMPX) $(PATHDEF_UUCICO)
+AM_CPPFLAGS = $(PATHDEF_BSHELL) $(PATHDEF_CONSOLE) $(PATHDEF_CP) 
$(PATHDEF_DEFPATH) $(PATHDEF_DEV) $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) 
$(PATHDEF_INETDPID) $(PATHDEF_KLOG) $(PATHDEF_LOG) $(PATHDEF_LOGCONF) 
$(PATHDEF_LOGIN) $(PATHDEF_LOGPID) $(PATHDEF_NOLOGIN) $(PATHDEF_RLOGIN) 
$(PATHDEF_RSH) $(PATHDEF_TTY) $(PATHDEF_TTY_PFX) $(PATHDEF_UTMP) 
$(PATHDEF_UTMPX) $(PATHDEF_UUCICO)
 
 SUIDMODE = -o root -m 4775
 
diff --git a/src/syslogd.c b/src/syslogd.c
index 4008967..1c36250 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -506,7 +506,8 @@ main (int argc, char *argv[])
     }
   else
     {
-      dbg_output = 1;
+      if (Debug)
+       dbg_output = 1;
       setvbuf (stdout, 0, _IOLBF, 0);
     }
 
@@ -554,10 +555,10 @@ main (int argc, char *argv[])
   consfile.f_un.f_fname = strdup (ctty);
 
   signal (SIGTERM, die);
-  signal (SIGINT, Debug ? die : SIG_IGN);
-  signal (SIGQUIT, Debug ? die : SIG_IGN);
+  signal (SIGINT, NoDetach ? die : SIG_IGN);
+  signal (SIGQUIT, NoDetach ? die : SIG_IGN);
   signal (SIGALRM, domark);
-  signal (SIGUSR1, Debug ? dbg_toggle : SIG_IGN);
+  signal (SIGUSR1, NoDetach ? dbg_toggle : SIG_IGN);
   alarm (TIMERINTVL);
 
   /* We add  3 = 1(klog) + 2(inet,inet6), even if they may stay unused.  */
@@ -640,8 +641,9 @@ main (int argc, char *argv[])
 
   signal (SIGHUP, trigger_restart);
 
-  if (Debug)
+  if (NoDetach)
     {
+      dbg_output = 1;
       dbg_printf ("Debugging disabled, send SIGUSR1 to turn on debugging.\n");
       dbg_output = 0;
     }
@@ -2134,7 +2136,8 @@ cfline (const char *line, struct filed *f)
 
     case '|':
       f->f_un.f_fname = strdup (p);
-      if ((f->f_file = open (++p, O_RDWR | O_NONBLOCK)) < 0)
+      f->f_file = open (++p, O_RDWR | O_NONBLOCK);
+      if (f->f_file < 0)
        {
          f->f_type = F_UNUSED;
          logerror (p);
@@ -2152,7 +2155,8 @@ cfline (const char *line, struct filed *f)
 
     case '/':
       f->f_un.f_fname = strdup (p);
-      if ((f->f_file = open (p, O_WRONLY | O_APPEND | O_CREAT, 0644)) < 0)
+      f->f_file = open (p, O_WRONLY | O_APPEND | O_CREAT, 0644);
+      if (f->f_file < 0)
        {
          f->f_type = F_UNUSED;
          logerror (p);
@@ -2231,7 +2235,7 @@ dbg_printf (const char *fmt, ...)
 {
   va_list ap;
 
-  if (!(Debug && dbg_output))
+  if (!(NoDetach && dbg_output))
     return;
 
   va_start (ap, fmt);
diff --git a/talkd/Makefile.am b/talkd/Makefile.am
index 320f52c..f654a05 100644
--- a/talkd/Makefile.am
+++ b/talkd/Makefile.am
@@ -35,6 +35,6 @@ talkd_SOURCES = \
 
 @PATHDEFS_MAKE@
 
-AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_UTMP) $(PATHDEF_UTMPX)
+AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_TTY_PFX) $(PATHDEF_UTMP) 
$(PATHDEF_UTMPX)
 INCLUDES = $(iu_INCLUDES)
 LDADD = $(iu_LIBRARIES)
diff --git a/telnetd/Makefile.am b/telnetd/Makefile.am
index 1f8d961..e18943a 100644
--- a/telnetd/Makefile.am
+++ b/telnetd/Makefile.am
@@ -29,7 +29,7 @@ noinst_HEADERS = telnetd.h
 
 @PATHDEFS_MAKE@
 
-AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_TTY) $(PATHDEF_LOGIN)
+AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_TTY) $(PATHDEF_TTY_PFX) $(PATHDEF_LOGIN)
 INCLUDES = $(iu_INCLUDES) -I$(top_srcdir) $(INCAUTH) $(NCURSES_INCLUDE)
 
 LDADD = $(iu_LIBRARIES) $(top_builddir)/libtelnet/libtelnet.a $(LIBTERMCAP) 
$(LIBUTIL) $(LIBCRYPT) $(LIBAUTH)
diff --git a/tests/.gitignore b/tests/.gitignore
index fbf984c..1901dcd 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,4 +1,5 @@
+addrpeek
 localhost
 readutmp
-addrpeek
 tools.sh
+waitdaemon
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b827bf5..d7d72a1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -21,7 +21,7 @@ AM_CPPFLAGS = $(iu_INCLUDES)
 
 LDADD = $(iu_LIBRARIES)
 
-check_PROGRAMS = localhost readutmp
+check_PROGRAMS = localhost readutmp waitdaemon
 if ENABLE_inetd
 check_PROGRAMS += addrpeek
 endif
@@ -68,7 +68,7 @@ if ENABLE_dnsdomainname
 dist_check_SCRIPTS += dnsdomainname.sh
 endif
 
-TESTS = localhost $(dist_check_SCRIPTS)
+TESTS = localhost waitdaemon $(dist_check_SCRIPTS)
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT)
 
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index c91a485..a1092f2 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -43,6 +43,9 @@ IU_TESTDIR    If set, use this as testing dir.  Unless
                NOCLEAN is also set, any created \$IU_TESTDIR
                will be erased after the test.  A non-existing
                directory must be named as a template for mktemp(1).
+OBSCURE                If set, make additional tests that are prone to
+               false negatives in some setups lacking full
+               connectivity.
 REMOTE_LOGHOST Add this host as a receiving loghost.
 TARGET         Receiving IPv4 address.
 TARGET6                Receiving IPv6 address.
@@ -307,8 +310,6 @@ fi
 #
 cat > "$CONF" <<-EOT
        *.*     $OUT
-       # Test incorrect forwarding.
-       *.*     @not.in.existence
        # Recover from missing action field and short selector.
        12345
        *.*
@@ -318,6 +319,18 @@ EOT
 # Add a user recipient in verbose mode.
 $silence false || echo "*.*    $USER" >> "$CONF"
 
+# Testing a remote log host known not to exist,
+# will introduce sizable timeout.  We avoid it
+# unless told to include this test, based on
+# OBSCURE in our environment.
+if [ -n "$OBSCURE" ]; then
+    # Append an invalid recipient.
+    cat >> "$CONF" <<-EOT
+       # Test incorrect forwarding.
+       *.*     @not.in.existence
+       EOT
+fi
+
 # Set REMOTE_LOGHOST to activate forwarding
 #
 if [ -n "$REMOTE_LOGHOST" ]; then
@@ -435,6 +448,7 @@ TAG2="syslogd-reload-test"
 
 # Load the new configuration
 kill -HUP `cat "$PID"`
+sleep 1
 
 if $do_unix_socket; then
     # Two messages, but absence is also awarded credit.
diff --git a/tests/utmp.sh b/tests/utmp.sh
index f19e467..556985c 100755
--- a/tests/utmp.sh
+++ b/tests/utmp.sh
@@ -34,25 +34,35 @@ if test -n "$VERBOSE"; then
     set -x
 fi
 
-# Execute READUTMP once without argument, and once with
-# ourself as argument.  Both should succeed, but if either
-# fails report only a skipped test, giving some complimentary
-# explanations.
-
 errno=0
 
-$READUTMP || errno=77
-
-$READUTMP `func_id_user` || errno=77
+if who >/dev/null 2>&1; then
+    # Check that readutmp agrees with who(1),
+    # limiting ourselves to at most three users.
+    for nn in `who | sed 's/ .*//; 3q;'`; do
+       $READUTMP $nn || errno=1
+    done
+else
+    # Execute READUTMP once without argument, and once with
+    # ourself as argument.  Both should succeed, but are reported
+    # as skipped test in case of failure.  They are known to be
+    # produce false positives in some circumstances.
+    $READUTMP || errno=77
+    $READUTMP `func_id_user` || errno=77
+fi
 
-if test $errno -ne 0; then
+if test $errno -eq 77; then
     cat >&2 <<-EOT
        NOTICE: read_utmp() from Gnulib just failed.  This can be
        due to running this test in sudo mode, or using a role.
        Should this script fail while running it as a logged in
        user, then read_utmp() is indeed broken on this system.
-       Then the present syslog and talkd are not fully functional.
-       You are then welcome to report this failure.
+       Then the present executables syslogd and talkd are not
+       fully functional.
+       EOT
+elif test $errno -eq 1; then
+    cat >&2 <<-EOT
+       User messaging is broken in syslogd and talkd.
        EOT
 fi
 
diff --git a/tests/waitdaemon.c b/tests/waitdaemon.c
new file mode 100644
index 0000000..1d66ee0
--- /dev/null
+++ b/tests/waitdaemon.c
@@ -0,0 +1,65 @@
+/* waitdaemon -- Verify that waitdaemon() is functional.
+  Copyright (C) 2010, 2011, 2012 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/'. */
+
+/* Verify that waitdaemon() in libinetutils.a is functional.
+   This is needed by syslogd.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <signal.h>
+#include <errno.h>
+
+#include <error.h>
+#include <progname.h>
+#include <libinetutils.h>
+#include <unused-parameter.h>
+
+extern int waitdaemon (int nochdir, int noclose, int maxwait);
+
+void
+doexit (int signo _GL_UNUSED_PARAMETER)
+{
+  _exit (EXIT_SUCCESS);
+}
+
+int
+main (int argc _GL_UNUSED_PARAMETER, char *argv[])
+{
+  pid_t ppid;
+
+  set_program_name (argv[0]);
+
+  signal (SIGTERM, doexit);    /* Parent exits nicely at SIGTERM.  */
+
+  ppid = waitdaemon (0, 0, 5); /* Five seconds of delay.  */
+
+  /* Child should return here before parent.  */
+  if (ppid > 0)
+    kill (ppid, SIGTERM);      /* Bless the parent process.  */
+
+  /* Only grand child reaches this statement.  */
+  return EXIT_FAILURE;
+}
diff --git a/whois/Makefile.am b/whois/Makefile.am
index f1363c0..5d59cf7 100644
--- a/whois/Makefile.am
+++ b/whois/Makefile.am
@@ -34,10 +34,10 @@ INCLUDES = $(iu_INCLUDES)
 LDADD = $(iu_LIBRARIES)
 
 as_del.h: $(srcdir)/as_del_list $(srcdir)/make_as_del.pl
-       perl $(srcdir)/make_as_del.pl < $(srcdir)/as_del_list > as_del.h
+       LANG=C perl $(srcdir)/make_as_del.pl < $(srcdir)/as_del_list > as_del.h
 
 ip_del.h: $(srcdir)/ip_del_list $(srcdir)/make_ip_del.pl
-       perl $(srcdir)/make_ip_del.pl < $(srcdir)/ip_del_list > ip_del.h
+       LANG=C perl $(srcdir)/make_ip_del.pl < $(srcdir)/ip_del_list > ip_del.h
 
 tld_serv.h: $(srcdir)/tld_serv_list $(srcdir)/make_tld_serv.pl
-       perl $(srcdir)/make_tld_serv.pl < $(srcdir)/tld_serv_list > tld_serv.h
+       LANG=C perl $(srcdir)/make_tld_serv.pl < $(srcdir)/tld_serv_list > 
tld_serv.h

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |   33 +++++++++++++++++++++++++
 configure.ac          |    2 -
 libinetutils/daemon.c |    2 +-
 src/Makefile.am       |    2 +-
 src/syslogd.c         |   20 +++++++++------
 talkd/Makefile.am     |    2 +-
 telnetd/Makefile.am   |    2 +-
 tests/.gitignore      |    3 +-
 tests/Makefile.am     |    4 +-
 tests/syslogd.sh      |   18 ++++++++++++-
 tests/utmp.sh         |   32 ++++++++++++++++--------
 tests/waitdaemon.c    |   65 +++++++++++++++++++++++++++++++++++++++++++++++++
 whois/Makefile.am     |    6 ++--
 13 files changed, 158 insertions(+), 33 deletions(-)
 create mode 100644 tests/waitdaemon.c


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]