guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCHES] Syslog produces no log (just for me?)


From: Ludovic Courtès
Subject: Re: [PATCHES] Syslog produces no log (just for me?)
Date: Mon, 30 Mar 2015 23:20:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Alex Kost <address@hidden> skribis:

> Nope, syslog.conf in store is fine.  The problem can be definitely
> solved for me by removing leading spaces.  Actually never mind, as I'm
> going to use my config for syslog-service, but anyway here is what
> happens when I start syslogd with the conf-file of the same contents as
> provided by 'syslog-service':
>
> # /run/current-system/profile/libexec/syslogd --debug --rcfile 
> /tmp/syslog-with-leading-spaces.conf
> init
> cfline(*.aauth.noth.notice;authpriv.none       /dev/console)
> syslogd: unknown priority name "aauth.noth.notice"
> (logmsg): syslog.err (43), flags 4, from localhost, msg syslogd: unknown 
> priority name "aauth.noth.notice"
> Logging to CONSOLE /dev/console
> cfline(*.iail.none.none;authpriv.none          /var/log/messages)
> syslogd: unknown priority name "iail.none.none"

Ooh, you found a genuine bug, as evidenced by the corrupt strings above.

Confirmed with Valgrind:

--8<---------------cut here---------------start------------->8---
$ valgrind ./src/syslogd --debug --rcfile 
/gnu/store/cz9n7s884mlr5y4x2bk8kq9hq44nnmaz-syslog.conf
==29582== Memcheck, a memory error detector
==29582== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==29582== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==29582== Command: ./src/syslogd --debug --rcfile 
/gnu/store/cz9n7s884mlr5y4x2bk8kq9hq44nnmaz-syslog.conf
==29582== 
init
==29582== Source and destination overlap in strcpy(0x55ebc00, 0x55ebc05)
==29582==    at 0x4C29C02: strcpy (in 
/gnu/store/13dzn85z8yhh6i977lwsii4wd7zjzyka-valgrind-3.10.1/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29582==    by 0x405D1B: load_conffile.constprop.5 (syslogd.c:1974)
==29582==    by 0x4060CF: init (syslogd.c:2109)
==29582==    by 0x402BAC: main (syslogd.c:601)
--8<---------------cut here---------------end--------------->8---

This patch placates Valgrind and seems to do the job:

diff --git a/src/syslogd.c b/src/syslogd.c
index 7af10f3..1db4455 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1971,7 +1971,7 @@ load_conffile (const char *filename, struct filed **nextp)
       if (*p == '\0' || *p == '#')
        continue;
 
-      strcpy (cline, p);
+      bcopy (p, cline, strlen (p));
 
       /* Cut the trailing spaces.  */
       for (p = strchr (cline, '\0'); isspace (*--p);)
Could you confirm that it solves the problem for you?  Just add it
locally to the inetutils recipe.

Thanks,
Ludo’.

reply via email to

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