Commit Graph

123 Commits

Author SHA1 Message Date
christos 069fe2afa8 PR/51234: Onno van der Linden: syslogd sometimes incorrectly handles iso to
bsd time conversion
2016-06-11 16:55:10 +00:00
dholland 64fc2fa3fc tidy/fix printing of paths from sockaddr_un 2015-09-05 20:19:43 +00:00
christos 7779d7745a - always set *to_buf to a timestamp, even if there was none reported/parseable
(Frank Kardel).
- merge the timestamp copying code to one place.
- factor out the debugging printf function.
2015-02-10 20:38:15 +00:00
jnemeth e0eccc7b53 - when checking hostname of incoming remote messages, fallback to checking
remote host if the message doesn't contain a hostname
- don't truncate IP addresses when reading syslogd.conf
2014-08-18 05:21:16 +00:00
christos fc0ed55151 CID 1132759: Abort on dehumanize_number error on constant built-in string. 2013-11-27 20:48:28 +00:00
christos ea5463304e CID 1128379: Fix TOCTOU, always open the file first with non-blocking I/O,
do that stat later and leave the file as non-blocking because it does not
make a difference for plain files.
2013-11-11 16:39:21 +00:00
christos d15656b177 add support for outputting to FIFO's (Anthony Mallet) 2013-11-09 19:00:18 +00:00
christos 06a74ca997 fix two bugs related to queues (Anthony Mallet)
- the default values are in humanized number form so strtol does not work
- fix reversed size tests
2013-11-09 18:58:22 +00:00
christos c68a8e00e8 PR/47861: Fredrik Pettai: keep track of the address family for each socket
opened and don't send the a message to the wrong family type.
2013-05-27 23:15:51 +00:00
christos dbf8567fb0 ut_line does not have /dev in front of it. Add it, from dholland@ 2013-01-17 18:54:28 +00:00
christos 14fb63db45 PR/47449: David Holland: Don't log to terminals with mesg n, unless it is a
wall message.
2013-01-15 22:37:04 +00:00
christos 8565a6a499 remove dup O_NDELAY. 2012-06-20 01:39:34 +00:00
christos 0787d10414 - fix writev1() to pre-decrement count.
- always open ttys with O_NDELAY.
2012-06-19 13:44:35 +00:00
christos dafeb4b2c4 don't call isatty() to the fd before opening it. 2012-06-18 19:17:42 +00:00
christos 92dd06985f WARNS=4 2012-06-06 00:33:45 +00:00
christos a480a96956 Open and write to ttys using non-blocking I/O to prevent DoS when hardware
or software flow control prevents tty writes or when the tty line is too
slow to respond.
2012-06-05 19:33:17 +00:00
christos 99b3039fe6 improve error handling. 2012-05-15 01:22:50 +00:00
christos 537334cc90 add aliases for the protocol format 2012-03-28 17:39:33 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
enami 7a059b3bd9 Now need to use own buffer for klog read due to previous change. 2011-06-20 08:27:15 +00:00
enami 9394c08bbe Defer the processing of incomplete line at the end of buffer so that
kernel printf messages logged to /var/log/messages become always
easier to read.
2011-06-20 00:42:11 +00:00
joerg b7d3c3b035 Explicitly mark a NEWREF as unused 2011-05-24 13:26:04 +00:00
joerg aeb74a68bf Properly use format strings 2011-05-24 13:25:25 +00:00
riz 634f514ee6 Allow syslogd to compile when MKCRYPTO=no. No promises as to whether
it works or not, as this has been broken since late 2008, when the
"encrypted connections" support was added to syslogd.
2010-06-09 21:55:42 +00:00
mschuett 499d95ff35 PR/40563: Takahiro Hayashi: syslogd(8) refers freed pointer on exiting 2009-02-06 21:09:46 +00:00
mschuett c998ee30ad PR/40438: Takahiro Hayashi: syslogd(8) refers freed area 2009-01-22 21:10:52 +00:00
lukem 64d3f79556 sign-compare fixes for amd64 2009-01-22 10:45:35 +00:00
lukem 7e0b2295e7 fix -Wsign-compare issues 2009-01-18 10:35:26 +00:00
christos 433a3ec2f3 fix suseconds_t format. 2008-12-29 03:45:23 +00:00
christos b3ed889133 PR/40043: Geoff C. Wing: syslogd timestamping and protocol parsing deficiencies
Syslogd does not properly handle:

1) the ADDDATE flag which is set with -T invocation and when messages
   come from the kernel.  Other cases where it is set it is ignored
   as timestamping is always done (e.g. logmsg_async())

2) the variable found_ts in check_timestamp().  It would determine
   whether or not the message had a (possibly valid) timestamp, set
   found_ts to true, then ignore that in most cases.  If we can't find
   a timestamp return.

3) messages without a parsable timestamp should get one when outputting
   the BSD syslog format so that a syslog-protocol timestamp isn't
   injected (chopped off with BSD syslog length) giving something like:
    "2008-11-27T15:0 cisco -: 1790:"
     ^ time might have been 2008-11-27T15:02:35.296497+11:00

4) syslog protocol version checking only checked for a leading numeral
   one (1) then skipped two places (presuming a space).  Messages sent
   from some sources (e.g. my cisco) may be
     "1795: Nov 27 04:12:52: %LINEPROTO-5-..."
   which would be chopped to
       "95: Nov 27 04:12:52: %LINEPROTO-5-..."
2008-11-27 20:37:21 +00:00
christos 61a52fac84 PR/39874: Geoff C. Wing: For compatibility trim hostname domains in bsd
output format when matching host lines.
2008-11-07 15:42:01 +00:00
minskim a325bf28ac Remove trailing whitespace. 2008-11-07 07:36:38 +00:00
christos 00f6effc9c use localtime_r 2008-11-04 18:52:25 +00:00
blymn d08a89fb84 Call tzset() to init TZ information for localtime(). 2008-11-04 10:01:56 +00:00
christos 9d5a7031b8 make sure that we memset the struct tm we pass to mktime and set isdst to -1
so that it will figure out if daylight savings is to be applied or not. From
Anon Ymous
2008-11-03 22:59:51 +00:00
christos 79e7aba61d PR/39857: Bernd Ernesti: Fix broken output caused by a wrong offset. From
Martin Schuette.
2008-11-03 02:44:01 +00:00
christos 1c6aec2060 Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
	  and draft-rfc timestamps
	- reliable tcp connections with queueing
	- encrypted connections
2008-10-31 16:12:18 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
dholland 16e3bec279 Clarify how one is supposed to use the pointers returned by getutentries()
(the utmpentry.c code), specifically with respect to who owns them and
when to free them. Now they're owned by utmpentry.c, only. Abolish the
freeutentries() function, which was the wrong abstraction; add instead
endutentries(), which flushes out the internally managed memory.

Update callers as necessary. Some (e.g. talkd) had been leaking memory;
others (e.g. syslogd) had been accidentally freeing and reloading utmp
more often than necessary. There are a couple untidy bits in users and
rwhod that someone should look after sometime, maybe.

Fixes PR bin/35131, which was about talkd's memory leak.
2008-07-13 20:07:48 +00:00
christos 381520cf11 PR/34979: Scott Ellis: Detect 0 length name and skip it instead of infinite
loop.
2006-11-13 20:24:00 +00:00
yamt 6c6dad782f matches_spec: fix a bug so that "+host111,host1" actually matches to host1.
add a simple sanity check.
2006-10-21 09:42:26 +00:00
christos 6ec268c772 PR/30879: Jukka Salmi: syslogd(8) doesn't parse `@' hostname specification
correctly
2006-09-16 17:05:32 +00:00
christos 6051bcc73f PR/28753: Martin J. Laubach: syslogd disables remote logging on non-fatal errors 2006-09-16 16:57:27 +00:00
wiz 8d3165ac32 Sync usage with man page (-b). 2006-09-16 06:34:55 +00:00
christos ca09b578d0 PR/14563: Brian A. Seklecki: syslogd binds udp sockets on all interfaces
Add -b option to pass a bind address.
2006-09-15 20:32:59 +00:00
snj a640fe8c43 It's "its." 2006-04-24 19:00:29 +00:00
pavel 43bd0b5956 PR 32579: Add a -T flag to syslogd, which causes it to use local time for
messages received from the network. Useful for collecting logs from
devices which do not have correct time.

Add it to usage.

Document it, also document that syslogd adds a timestamp with the local
time if it does not recognize the original timestamp field. Bump date.

Approved by wrstuden@.
2006-04-19 21:18:50 +00:00
lukem 1fab072e48 appease gcc -Wuninitialized 2005-06-02 09:42:57 +00:00
christos de883a09a8 Abolish the magic 7, and count iovectors explicitly. 2005-01-09 00:07:27 +00:00
matt c7914c97fe Make syslogd automatically recover from full disks by noticing that the
write error was ENOSPC and either wait for a successfull write or a
different errno.
2004-12-09 00:56:47 +00:00