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-287-ge4c1a


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-287-ge4c1a64
Date: Tue, 14 May 2013 20:40: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  e4c1a64a7b1a81078424ce5c1512864d9385e942 (commit)
      from  3864a49a23d70caddedddd4a52ed10ee443ee192 (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=e4c1a64a7b1a81078424ce5c1512864d9385e942


commit e4c1a64a7b1a81078424ce5c1512864d9385e942
Author: Mats Erik Andersson <address@hidden>
Date:   Tue May 14 22:36:33 2013 +0200

    telnetd: Silence unwanted debugging.
    
    New debugging mode `encr'.  Do not add text
    for `auth' and `encr' into `/tmp/telnet.debug'
    without explicit debug setting.

diff --git a/ChangeLog b/ChangeLog
index 584f857..1c8e2be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2013-05-14  Mats Erik Andersson  <address@hidden>
 
+       telnetd: Silence unwanted debugging.
+
+       * telnetd/telnetd.h (enum debug_mode): Add `debug_encr'.
+       * telnetd/telnetd.c (debug_mode): Add member `encr'.
+       * telnetd/utility.c (printsub): Return immediately if
+       the option is TELOPT_AUTHENTICATION or TELOPT_ENCRYPT
+       and the corresponding debug level is unset.
+
+       telnetd: Logging of failed command line options.
+
+       * telnetd/telnetd.c (main): Call openlog() before
+       argp_parse().  Facility is now correct!
+       (parse_linemode): Send a log notice
+       about parsing failure; the client receives stderr!
+       (parse_authmode) [AUTHENTICATION]: Likewise.
+       (parse_debug_level): Likewise.
+
+2013-05-14  Mats Erik Andersson  <address@hidden>
+
        libtelnet: The list of authentication names is
        allowed to contain NULL entries.  Prevent access
        to such entries.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index ad7870a..1843fd3 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -4706,17 +4706,18 @@ Specify what mode to use for authentication.  Allowed 
values are:
 @opindex --debug
 Set the debugging level.  The argument is a comma separated list of
 these categories: @samp{options}, @samp{report}, @samp{netdata},
address@hidden, and @samp{auth}.  All these may be used in the form
address@hidden  Omission of @samp{level} implies the maximal
-possible debugging for that particular category.
address@hidden, @samp{auth}, and @samp{encr}.
+All these may be used in the form @samp{name[=level]}.
+Omission of @samp{level} implies the maximal
+possible debugging level for that particular category.
 
-There is one additional category @samp{tcp}, that does not allow
-the additional level indicator, but is instead equivalent to
+There is one additional category @samp{tcp}, which does not take
+an additional level indicator, but is instead equivalent to
 setting the socket option @samp{SO_DEBUG} for debugging the
 complete traffic.
 
-The outcome is the file @file{/tmp/telnet.debug}, to which
-data is incrementally added as time passes.
+The output is written to the file @file{/tmp/telnet.debug},
+and any new data is incrementally added as time passes.
 
 @item -E @var{string}
 @itemx address@hidden
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index f7886f3..2736545 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -205,12 +205,14 @@ main (int argc, char **argv)
 
   set_program_name (argv[0]);
   iu_argp_init ("telnetd", default_program_authors);
+
+  openlog ("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
+
   argp_parse (&argp, argc, argv, 0, &index, NULL);
 
   if (argc != index)
     error (EXIT_FAILURE, 0, "junk arguments in the command line");
 
-  openlog ("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
   telnetd_setup (0);
   return telnetd_run ();
 }
@@ -223,7 +225,7 @@ parse_linemode (char *str)
   else if (strcmp (str, "nokludge") == 0)
     lmodetype = NO_AUTOKLUDGE;
   else
-    fprintf (stderr, "telnetd: invalid argument to --linemode\n");
+    syslog (LOG_NOTICE, "invalid argument to --linemode: %s", str);
 }
 
 #ifdef  AUTHENTICATION
@@ -241,7 +243,7 @@ parse_authmode (char *str)
   else if (strcasecmp (str, "off") == 0)
     auth_level = -1;
   else
-    fprintf (stderr, "telnetd: unknown authorization level for -a\n");
+    syslog (LOG_NOTICE, "unknown authorization level for -a: %s", str);
 }
 #endif /* AUTHENTICATION */
 
@@ -255,7 +257,9 @@ static struct
   {"report", debug_report},
   {"netdata", debug_net_data},
   {"ptydata", debug_pty_data},
-  {"auth", debug_auth},};
+  {"auth", debug_auth},
+  {"encr", debug_encr},
+};
 
 void
 parse_debug_level (char *str)
@@ -301,7 +305,7 @@ parse_debug_level (char *str)
          }
 
       if (i == debug_max_mode)
-       fprintf (stderr, "telnetd: unknown debug mode: %s", tok);
+       syslog (LOG_NOTICE, "unknown debug mode: %s", tok);
     }
 }
 
diff --git a/telnetd/telnetd.h b/telnetd/telnetd.h
index 6443195..6236722 100644
--- a/telnetd/telnetd.h
+++ b/telnetd/telnetd.h
@@ -73,6 +73,7 @@ typedef enum debug_mode
   debug_net_data,
   debug_pty_data,
   debug_auth,
+  debug_encr,
   debug_max_mode
 } debug_mode_t;
 
diff --git a/telnetd/utility.c b/telnetd/utility.c
index 028afb2..be3507f 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -940,6 +940,14 @@ printsub (int direction, unsigned char *pointer, int 
length)
   unsigned char buf[512];
 #endif
 
+  /* Silence unwanted debugging to '/tmp/telnet.debug'.
+   *
+   * XXX: Better location?
+   */
+  if ((pointer[0] == TELOPT_AUTHENTICATION && debug_level[debug_auth] < 1)
+      || (pointer[0] == TELOPT_ENCRYPT && debug_level[debug_encr] < 1))
+    return;
+
   if (direction)
     {
       debug_output_data ("td: %s suboption ",

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

Summary of changes:
 ChangeLog          |   19 +++++++++++++++++++
 doc/inetutils.texi |   15 ++++++++-------
 telnetd/telnetd.c  |   14 +++++++++-----
 telnetd/telnetd.h  |    1 +
 telnetd/utility.c  |    8 ++++++++
 5 files changed, 45 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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