summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Move the handlers for the poll events into separate functions. Theybluhm2014-09-041-50/+67
| | | | | will become the libevent callbacks later. input and OK doug@
* The reapchild() signal handler collects all children. This can bebluhm2014-08-311-15/+2
| | | | | done easier by ignoring SIGCHLD. OK guenther@
* Do not call free() on an array in the data section. Fortunatelybluhm2014-08-311-2/+1
| | | | | the code was not reached. No binary change. OK miod@ guenther@
* Allow to restrict syslogd to a protocol family with -4 and -6 commandbluhm2014-08-251-10/+58
| | | | | | | line switches. If the log server is an FQDN, DNS chooses wether to take the IPv4 or IPv6 route. Allow to prefix the log host with udp4:// or udp6:// to choose a protocol. OK henning@
* Fix the gcc compiler warnings "comparison between signed andbluhm2014-08-251-10/+11
| | | | | | unsigned". Some checks got stricter. The (size_t) cast is only done, if the argument is not negative. OK henning@
* Instead of getting a nasty error message from privsepbluhm2014-08-221-3/+16
| | | | | | "syslogd: priv_getaddrinfo: overflow attempt in hostname" check the host and port length when parsing the config. OK henning@
* Send and receive UDP syslog packets on the IPv6 socket.bluhm2014-08-211-19/+40
| | | | OK henning@
* Parse loghost in a separate function. Allow [] around hostname,bluhm2014-08-211-15/+42
| | | | | | needed for IPv6 addresses. Print full loghost specifier in case of error or debug. Make string sizes more precise. input henning@; input and OK deraadt@
* Replace gethostbyaddr(3) with getnameinfo(3). Remove the sigprocmask()bluhm2014-08-201-28/+10
| | | | | | | that was necessary for gethostbyaddr() because the latter is not signal safe. Change the return code semantics of priv_getnameinfo() to match getnameinfo(3). input and OK jca@
* Rename priv_gethostserv() to priv_getaddrinfo() as this is what thebluhm2014-08-201-6/+5
| | | | | function does. Change the return code semantics to match getaddrinfo(3). OK deraadt@
* Fix trailing white spaces.bluhm2014-08-191-5/+5
| | | | OK sthen@
* Create a socketpair() and tie one end to /dev/klog using ioctl LIOCSFD.deraadt2014-07-141-2/+14
| | | | | | | This allows us to receive messages direct from programs using the fd-safe sendsyslog(2), aka. syslog_r(3). Thanks to guenther for this part of the solution. ok beck tedu miod guenther
* Remote logging could get stuck after a "network is unreachable"bluhm2014-02-041-1/+2
| | | | | error occured. Put ENETUNREACH into the list of ignored errors. OK markus@ sthen@ millert@
* more unsigned char casts for ctypederaadt2013-11-241-14/+16
| | | | ok jca
* Trim leading white space from the message before trying to extractmillert2013-10-091-2/+4
| | | | | | the program name. Works around a problem with the ObiHai 202's syslog client (and possibly others) where an extra space is added to the message before the program name. OK krw@ henning@ deraadt@
* remove casts to time_t * which are not neededderaadt2013-04-161-2/+2
|
* handle ECONNABORTED errors from accept(). In many code blocks they can bederaadt2013-03-111-2/+3
| | | | | ignored silently and without aborting, much like EINTR and EWOULDBLOCK are. ok's from various maintainers of these directories...
* -h includes RFC 3164 style hostnames when forwarding;markus2013-02-101-4/+10
| | | | feedback and ok sthen@, mpf@
* 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
|