aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd
Commit message (Collapse)AuthorAgeFilesLines
* Use SRCTOP instead of .CURDIR relative paths with ".."Enji Cooper2017-02-241-2/+2
| | | | | | | | | | This simplifies pathing in make/displayed output MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314226
* Sort sys/ #includes some moreEnji Cooper2017-02-071-2/+2
| | | | | | | | | MFC after: 1 week X-MFC with: r313358 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313360
* Sort sys/ #includes and zap an unnecessary trailing space nearbyEnji Cooper2017-02-071-7/+7
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313358
* Use a flexible array for TypeNames instead of hardcoding the array lengthEnji Cooper2017-02-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313357
* Fix typos in comments (returing -> returning)Enji Cooper2017-02-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313356
* Fix a bug which caused not to create AF_LOCAL sockets when familyHiroki Sato2017-01-281-1/+2
| | | | | | | | | is specified. Spotted by: Alex Deiter Notes: svn path=/head/; revision=312921
* Add more #ifdef INET and INET6.Hiroki Sato2017-01-111-2/+25
| | | | Notes: svn path=/head/; revision=311918
* - Use more descriptive names for variables.Hiroki Sato2016-12-311-33/+37
| | | | | | | | | - Set O_CLOEXEC to the signal pipe and /dev/klog. - Use a single signal handler to catch both SIGHUP and SIGCHLD. - Fix a bug which did FD_SET() the writer-end of the pipe. Notes: svn path=/head/; revision=310974
* Remove extra NULL-check before free(3).Hiroki Sato2016-12-311-2/+1
| | | | Notes: svn path=/head/; revision=310893
* Replace two fat signal handlers with function calls inHiroki Sato2016-12-311-66/+68
| | | | | | | | | | | | | the main I/O multiplex loop. select() now watches a pipe which is written by the new skinny signal handlers and the received signals are handled inside the loop sequencially. This eliminates a complex signal mask to guarantee async-signal safety. Notes: svn path=/head/; revision=310890
* Retry to open an F_PIPE process when it dies unexpectedly.Hiroki Sato2016-12-311-16/+18
| | | | | | | | Reported by: Eugene Grosbein PR: 215335 Notes: svn path=/head/; revision=310888
* - Fix -N flag (NoBind) for AF_LOCAL sockets.Hiroki Sato2016-12-241-12/+21
| | | | | | | - Do setsockopt(SO_RCVBUF) for AF_LOCAL sockets regardless of -s flag. Notes: svn path=/head/; revision=310528
* Unbreak syslogd after r310494Enji Cooper2016-12-241-1/+2
| | | | | | | | | | | | | Don't close all file descriptors greater than STDERR_FILENO (2) in waitdaemon(..) -- only close fd (file descriptor for /dev/null used in subsequent calls to dup2) if it's greater than STDERR_FILENO. Reported by: subbsd@gmail.com, danny@cs.huji.ac.il Pointyhat to: hrs X-MFC with: r310494 Notes: svn path=/head/; revision=310504
* - Remove unused code.Hiroki Sato2016-12-241-9/+6
| | | | | | | - Use closefrom(). Notes: svn path=/head/; revision=310494
* - More ifdef INET and INET6.Hiroki Sato2016-12-231-17/+34
| | | | | | | | - Use STDERR_FILENO + 1 instead of "3". - Fix dprintf() in cvthname(). Notes: svn path=/head/; revision=310456
* mdoc and style fixes.Hiroki Sato2016-12-231-47/+82
| | | | Notes: svn path=/head/; revision=310453
* - Fix a use-after-free bug when dq_timeout == 1 andHiroki Sato2016-12-221-32/+35
| | | | | | | | | | | sending SIGTERM to the process failed. It is an unusual situation but it can happen. - Split deadq_remove() into deadq_remove() and deadq_removebypid(). - Normalize variable names of struct deadq_entry *. Notes: svn path=/head/; revision=310393
* Add a missing "default:" case.Hiroki Sato2016-12-221-0/+2
| | | | Notes: svn path=/head/; revision=310386
* Initialize a structure by using a compound literal to avoid forgettingHiroki Sato2016-12-221-48/+51
| | | | | | | to zero unspecified members. Notes: svn path=/head/; revision=310385
* Fix debug log in the case of AF_INET6.Hiroki Sato2016-12-221-6/+12
| | | | Notes: svn path=/head/; revision=310384
* - Simplify masklen->netmask conversion for AF_INET6.Hiroki Sato2016-12-221-65/+81
| | | | | | | | - Use iov[N] by array index instead of using pointer v = &iov[0] to make the compiler catch an out-of-range access of the array. Notes: svn path=/head/; revision=310383
* Simplify type casting of struct sockaddr_in.Hiroki Sato2016-12-211-13/+13
| | | | Notes: svn path=/head/; revision=310352
* - Initialize deadq_head statically.Hiroki Sato2016-12-211-13/+14
| | | | | | | | | - Fix indent. - Add missing -S flag into usage(). - Use nitems() for an iov array instead of a macro. Notes: svn path=/head/; revision=310351
* - Add fklog into struct socklist. Files and local/remote sockets areHiroki Sato2016-12-211-142/+188
| | | | | | | | | | now processed in struct socklist in a consistent manner. - Add helper functions to add a new entry of struct socklist, filed, or peer. - Use the same routine for -l, -p, and -S. - Close /dev/klog when read(2) failed. Notes: svn path=/head/; revision=310350
* - Use fnmatch(3) for domanname matching of -a options.Hiroki Sato2016-12-212-29/+11
| | | | | | | | - Document the patten matching. - Document -S flag in SYNOPSIS. Notes: svn path=/head/; revision=310349
* Escape punctuation characters.Hiroki Sato2016-12-201-6/+6
| | | | Notes: svn path=/head/; revision=310323
* Add a NULL check.Hiroki Sato2016-12-201-0/+2
| | | | Notes: svn path=/head/; revision=310311
* Add a default socket bound to *:514 when no -b option is specified.Hiroki Sato2016-12-201-1/+10
| | | | | | | | | This was accidentally removed at r309933. Spotted by: Michael Butler Notes: svn path=/head/; revision=310310
* Add a missing STAILQ_INSERT_TAIL() for allowaddr rule.Hiroki Sato2016-12-191-26/+31
| | | | Notes: svn path=/head/; revision=310278
* Remove an extra "break" which could incorrectly terminate anHiroki Sato2016-12-131-6/+0
| | | | | | | | | STAILQ_FOREACH() loop when an AF_INET6 rule matched. Spotted by: cem Notes: svn path=/head/; revision=310035
* - Refactor listening socket list. All of the listening sockets areHiroki Sato2016-12-122-416/+380
| | | | | | | | | | | | | | | | | now maintained in a single linked-list in a transport-independent manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include <sys/type.h>. - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. Notes: svn path=/head/; revision=309933
* Temporarily backout the previous commit because it was totally broken due toHiroki Sato2016-12-122-380/+415
| | | | | | | | | unresolved merge conflicts. Pointy hat to: hrs Notes: svn path=/head/; revision=309931
* - Refactor listening socket list. All of the listening sockets areHiroki Sato2016-12-122-415/+380
| | | | | | | | | | | | | | | | | now maintained in a single linked-list in a transport-independent manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include <sys/type.h>. - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. Notes: svn path=/head/; revision=309925
* Properly initialize nextpBaptiste Daroussin2016-11-271-1/+1
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=309216
* initialize *nextp which could be left uninitialized in case the configurationBaptiste Daroussin2016-11-261-0/+1
| | | | | | | | | | | file cannot be open/read Reported by: Coverity via cem MFC after: 2 days CID: 1365665 Notes: svn path=/head/; revision=309194
* syslogd(8): add an 'include' keywordBaptiste Daroussin2016-11-012-82/+162
| | | | | | | | | | | | | | | | | | | | | All the '.conf' files not beginning with a '.' contained int he directory following the keyword will be included. This keyword can only be used in the first level configuration files. Modify the default syslogd.conf to 'include' /etc/syslog.d and /usr/local/etc/syslog.d It simplify a lot handling of syslog from automation tools. Reviewed by: markj, kib (via irc) Approved by: markj MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D8402 Notes: svn path=/head/; revision=308160
* Directly set the O_NONBLOCK flags via open(2)Baptiste Daroussin2016-09-111-4/+1
| | | | Notes: svn path=/head/; revision=305707
* syslogd: Enable repeated line compression for lines of any length.Alan Somers2016-01-271-1/+1
| | | | | | | | | | | | | | | Enable repeated line compression for lines of any length, instead of only short lines. AFAICT repeated line compression was limited to short lines as a RAM optimization, which made sense when karels added it in 1988, but no longer. The penalty is a paltry 904B of RAM per file logged. Reviewed by: rpaulo MFC after: 32 days Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4475 Notes: svn path=/head/; revision=294924
* Have syslogd honor 'mesg' status when logging to users.Kurt Lidl2015-11-251-1/+25
| | | | | | | | | | PR: bin/196742 Submitted by: jef at mail acme com Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D4270 Notes: svn path=/head/; revision=291328
* die() would never return, mark it as so.Xin LI2015-08-271-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=287217
* Set f_file to -1/F_UNUSED when after closing when possibleEnji Cooper2015-08-051-8/+20
| | | | | | | | | | | | | | | | This will help ensure we don't trash file descriptors that get used later on in the daemon Found via internal Coverity scan MFC after: 2 weeks Discussed with: cem, ed, markj Differential Revision: https://reviews.freebsd.org/D3081 Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=286304
* syslogd: re-read the timezone when receive a SIGHUP.Rui Paulo2015-06-161-0/+18
| | | | | | | | | | | | | | syslogd already re-reads the configuration file and the hostname when receiving a SIGHUP, so it makes sense to reset the timezone. Special care was taken to ensure we don't break installations running with a custom TZ variable. PR: 196905 Submitted by: Kurt Lidl <lidl pix.net> Sponsored by: Pi-Coral, Inc. Notes: svn path=/head/; revision=284476
* syslogd: don't leak finet0.Rui Paulo2015-06-161-0/+1
| | | | | | | | Submitted by: Kurt Lidl <lidl pix.net> Sponsored by: Pi-Coral, Inc. Notes: svn path=/head/; revision=284475
* syslogd: support multiple -b options.Rui Paulo2015-06-162-8/+44
| | | | | | | | | | | It's now possible to bind multiple sockets to different IP addresses. PR: 159305 Submitted by: Kurt Lidl <lidl pix.net> Sponsored by: Pi-Coral, Inc. Notes: svn path=/head/; revision=284474
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-274-17/+28
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720