summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Allow syslogc -n XX to display less than the whole file, and -n XX -f tosthen2011-07-121-3/+7
| | | | display more/less than the default of 10. ok mpf@ jmc@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-15/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* initialize both sides of the lockpipe (only used in debug mode) to -1 toderaadt2008-09-291-3/+3
| | | | have averted the bug found in pr 5938
* If a |program is too slow to process the input,mpf2008-04-211-3/+15
| | | | | | | drop messages rather than to kill and restart it. Also log this error, but limited at a 2 minute rate. Discussed with henning. OK henning@
* remove "unused variable" warningschl2007-10-171-4/+3
| | | | | | tested by deraadt@ on a gcc2 arch looks ok ray@ ok deraadt@
* Initialize length variable slen properly to avoid possible EINVALbluhm2007-09-071-2/+3
| | | | | errors from setsockopt(2) in function double_rbuf(). ok markus@ mpf@
* - use getaddrinfo() instead of gethostbyname/getservbynamejason2007-05-021-24/+49
| | | | | - reserve a poll descriptor entry for INET6 (not used yet) ok henning
* Preserve the contents of the memory buffers when syslogd reinitializescanacar2007-03-301-13/+54
| | | | | logs in response to a HUP signal, as long as /etc/syslog.conf remains unchanged. ok mpf@
* Create "syslogd: restart" message after the setup of signalmpf2007-02-211-6/+9
| | | | | | | handlers. This prevents a race where syslogd could die on SIGPIPE at startup. Also distinguish between start and restart. OK henning@
* implement logging to other program's stdin.henning2007-02-201-12/+34
| | | | | | | | | | if the target is like "| /path/to/program", syslogd forks and execs program and sends the selected log messages to program's stdin. uses a socketpair, grows the receive buffer on the reader side and has the socket nonblocking on syslog'd side to prevent syslogd blocking. I'm using that here to feed logsurfer from ports for automated log analysis, werks beautifully. lots of input & help mpf, ok mpf djm "no objections" millert
* Support for continuous reading of syslog memory buffers.mpf2007-01-031-18/+107
| | | | | Works like ``tail -f'' on a log file. OK markus@, djm@
* check that stdio file descriptors are actually closed before clobberingdjm2006-09-171-6/+7
| | | | them, following an identical change in openssh
* If any of fds 0-2 are not open, dup them to our /dev/null fd.millert2005-06-101-4/+12
| | | | Prevents the socket from being closed in this case. OK deraadt@
* memory leak on SIGHUP for memory buffer logs, based on fix by Stephen Marley;djm2005-06-061-2/+5
| | | | ok avsm@
* avoid looping on failed tty or /dev/console writes and just drop the messagedjm2005-04-211-4/+6
| | | | noticed by newell AT cei.net; ok avsm@ deraadt@
* shutdown the inetd socket for reading if secure; ok deraadtmarkus2005-03-121-16/+16
|
* avoid a null dereference when using membufs.danh2004-12-221-10/+11
| | | | ok otto@ millert@
* silently ignore some cases when sendto(2) fails rather than disablingdanh2004-12-211-4/+14
| | | | | | | | logging to a remote host. Similar patch sent by Marc Huber <Marc.Huber@web.de> in PR4044. ok deraadt@ henning@ millert@
* Fix one case of broken duplicate supression, which happens if two linesotto2004-12-201-18/+58
| | | | | | | | | | | | | | in syslog.conf contain the same target file, and log entries matching both the first and second line get written. This changes behaviour: e.g. previously repeating a line caused a log entry to be written twice, but not any more. Also, if a later line with the same target has a different priority for a facility, the last one will be used. Noted by camield@; help from millert@. ok camield@ millert@ hshoexer@ deraadt@
* strchr("whatever", 0) returns non NULL. From Patrick Latifi.otto2004-11-111-3/+3
| | | | ok deraadt@ millert@
* size_t vs ssize_t confusionderaadt2004-09-141-6/+8
|
* ARGSUSED before signal handler with unused signoderaadt2004-09-141-2/+5
|
* -Wall,-Wshadow cleanup with avsm@; ok henning@ krw@djm2004-07-031-13/+10
|
* support @hostname:port syntax in syslog.conf, prompted by msf@ at c2k4;djm2004-07-031-18/+24
| | | | ok henning@ anil@
* extend memory buffer control protocol to support transmission of flags,djm2004-06-251-27/+75
| | | | | | | | starting with one to indicate whether the memory ringbuffers have overflowed; idea & ok markus@ NB if you are using memory buffered logging make sure you update both syslogd and syslogc _and_ restart syslogd because the protocol has changed
* allow '!!prog', where the second '!' means messages from prog should onlydhartmei2004-06-031-4/+13
| | | | | | be logged by the subsequent block, aborting evaluation when matching. Useful to log some daemons to dedicated files only (not polluting standard files with their messages). ok beck@, henning@, millert@
* Interpret !* correcly. ok dhartmei@otto2004-06-031-3/+3
|
* include hostname in memory buffered logs, spotted bydjm2004-05-251-4/+5
| | | | ssurdock AT engineered-net.com; ok deraadt@
* Prevent another instance of syslogd from unlinking log sockets thatmillert2004-04-151-23/+35
| | | | are already in use. Found by mpech@, OK deraadt@
* fix null pointer dereference when trying to read+clear non-existent memorydjm2004-04-131-5/+4
| | | | log; spotted by mpech@
* Check malloc() return value. Pointed out by mpech@. Ok mpech@, deraadt@millert2004-01-191-3/+6
|
* buffer size should be unsigned, report mpech@; ok deraadt@djm2004-01-131-3/+4
|
* sort options and SYNOPSIS;jmc2004-01-051-4/+4
| | | | sync usage();
* spacingderaadt2004-01-041-3/+3
|
* Buffered logging for syslogd. Logs may be stored in memory buffers anddjm2004-01-041-45/+384
| | | | | extracted using a small client. Useful for diskless systems. much feedback from deraadt@, canacar@, jmc@, jakob@ ; ok deraadt@
* spacingderaadt2003-12-291-5/+5
|
* convert from select() to poll() for main event loop; tested millert@, deraadt@djm2003-12-291-73/+59
| | | | ok deraadt@
* whack getopt ? matching; jeffi@rcn.comderaadt2003-09-191-3/+2
|
* Call tzset() to stash the current timezone before we chroot.millert2003-08-181-2/+4
| | | | OK deraadt@ and avsm@
* Privilege separated syslog daemon. The child listening to log requests dropsavsm2003-07-311-64/+120
| | | | | | | | | | | | | to user _syslogd and chroots itself, while the privileged parent grants it access to open logfiles and other calls it needs. The only difference from existing behaviour is that if syslog.conf changes and syslogd receives a HUP, it will re-exec itself and have two new PIDs. A HUP with an unchanged config will make syslogd reopen logfiles as before. Lots of help and code from deraadt@ , and advice from millert@ Various versions tested by todd, cloder, mpech, markus, tdeval and others
* dont silently truncate a domain socket specified via the -p argument;avsm2003-07-081-3/+8
| | | | error out instead if its too long. deraadt@ ok
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Fix typo in last commit, spotted by Brian Poole. That'll teach memillert2003-05-171-3/+3
| | | | to commit on an empty stomach.
* Cannot use strlcpy() for strings in struct utmp since they are not guaranteedmillert2003-05-171-3/+5
| | | | to be NUL-terminated. Fixes a bug introduced in rev 1.37; noticed by deraadt@
* Fix default facility when none is specified (should be LOG_USER,millert2003-03-211-4/+8
| | | | was LOG_UUCP due to a bug); Javier Kohen
* fix cutnpaste; from hunter@comsys.com.uamickey2002-12-221-3/+3
|
* Add -n option to print message source addresses numerically rather thancloder2002-11-211-11/+18
| | | | | | | symbolically. This saves address->name lookups, which is nice on log servers without a DNS cache. millert@, jakob@ ok
* use more socklen_t; pvalchevderaadt2002-09-061-4/+4
|
* Pass correct buffer length to snprintf on error condition; ericj@, fgsch@ ok.aaron2002-08-081-3/+3
|
* Sanity check snprintf() return values before using them. It is legal formillert2002-07-241-15/+19
| | | | snprintf(3) to return -1.