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_2-15-g1db1e9


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-15-g1db1e91
Date: Fri, 28 Mar 2014 10:28:29 +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  1db1e91f34f1c31a297c3c65417ac4f93a7a404f (commit)
      from  765036a319083f5861c1e056da2eaf23e1e20758 (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=1db1e91f34f1c31a297c3c65417ac4f93a7a404f


commit 1db1e91f34f1c31a297c3c65417ac4f93a7a404f
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Mar 28 11:21:35 2014 +0100

    syslogd: Local time option.

diff --git a/ChangeLog b/ChangeLog
index c63d0fa..a5155b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2014-03-28  Mats Erik Andersson  <address@hidden>
+
+       syslogd: Local time option.
+
+       * src/syslogd.c (set_local_time): New variable.
+       (option enum): Remove OPT_PIDFILE.
+       (argp_options) <pidfile>: New alias 'P'.
+       <-T/--local-time>: New option.
+       (parse_opt) <case 'P'>: Replaces OPT_PIDFILE.
+       <case 'T'>: 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  <address@hidden>
 
        ifconfig: Parse address family.
diff --git a/NEWS b/NEWS
index 41a008b..ec49848 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,16 @@ Foundation, Inc.  See the end of this file for license 
conditions.
 
 Please send inetutils bug reports to <address@hidden>.
 
+Version 1.9.3:
+
+* syslogd
+
+A new switch `-T/--local-time' makes the service ignore a time
+stamp passed on by the remote host, instead recording the local
+time at the moment the message was recorded.
+As a short form of  `--pidfile', the switch `-P' is new.
+
+
 December 23, 2013
 Version 1.9.2:
 
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index ede0772..b2b48a8 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -3304,7 +3304,9 @@ Override configuration (the default file is 
@file{/etc/syslog.conf}).
 @opindex --rcdir
 Override configuration directory (the default is @file{/etc/syslog.d}).
 
address@hidden address@hidden
address@hidden -P @var{file}
address@hidden address@hidden
address@hidden -P
 @opindex --pidfile
 Override pidfile (the default file is @file{/var/run/syslogd.pid}).
 
@@ -3402,6 +3404,15 @@ allowed.
 @opindex -s
 List of domains which should be stripped from the FQDN of hosts before
 logging their name.  Multiple lists are allowed.
+
address@hidden -T
address@hidden --local-time
address@hidden -T
address@hidden --local-time
+Ignore any time contained in a received message.
+In its stead, record the time of reception on the local
+system.  This circumvents problems caused by remote hosts
+with skewed clocks.
 @end table
 
 @section Configuration file
diff --git a/src/syslogd.c b/src/syslogd.c
index 48b8d9c..cc96439 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -315,6 +315,7 @@ int NoForward;                      /* Don't forward 
messages.  */
 time_t now;                    /* Time use for mark and forward supending.  */
 int force_sync;                        /* GNU/Linux behaviour to sync on every 
line.
                                   This off by default. Set to 1 to enable.  */
+int set_local_time = 0;                /* Record local time, not message time. 
 */
 
 const char args_doc[] = "";
 const char doc[] = "Log system messages.";
@@ -324,7 +325,6 @@ enum {
   OPT_NO_FORWARD = 256,
   OPT_NO_KLOG,
   OPT_NO_UNIXAF,
-  OPT_PIDFILE,
   OPT_IPANY
 };
 
@@ -356,7 +356,7 @@ static struct argp_option argp_options[] = {
 #endif
   {"no-unixaf", OPT_NO_UNIXAF, NULL, 0, "do not listen on unix domain "
    "sockets (overrides -a and -p)", GRP+1},
-  {"pidfile", OPT_PIDFILE, "FILE", 0, "override pidfile (default: "
+  {"pidfile", 'P', "FILE", 0, "override pidfile (default: "
    PATH_LOGPID ")", GRP+1},
   {"rcfile", 'f', "FILE", 0, "override configuration file (default: "
    PATH_LOGCONF ")",
@@ -366,6 +366,7 @@ static struct argp_option argp_options[] = {
   {"socket", 'p', "FILE", 0, "override default unix domain socket " PATH_LOG,
    GRP+1},
   {"sync", 'S', NULL, 0, "force a file sync on every line", GRP+1},
+  {"local-time", 'T', NULL, 0, "set local time on received messages", GRP+1},
 #undef GRP
   {NULL, 0, NULL, 0, NULL, 0}
 };
@@ -446,7 +447,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
       NoUnixAF = 1;
       break;
 
-    case OPT_PIDFILE:
+    case 'P':
       PidFile = arg;
       break;
 
@@ -467,6 +468,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
       force_sync = 1;
       break;
 
+    case 'T':
+      set_local_time = 1;
+      break;
+
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -1181,7 +1186,10 @@ logmsg (int pri, const char *msg, const char *from, int 
flags)
     timestamp = ctime (&now) + 4;
   else
     {
-      timestamp = msg;
+      if (set_local_time)
+       timestamp = ctime (&now) + 4;
+      else
+       timestamp = msg;
       msg += 16;
       msglen -= 16;
     }

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

Summary of changes:
 ChangeLog          |   13 +++++++++++++
 NEWS               |   10 ++++++++++
 doc/inetutils.texi |   13 ++++++++++++-
 src/syslogd.c      |   16 ++++++++++++----
 4 files changed, 47 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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