summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd
Commit message (Collapse)AuthorAgeFilesLines
* MFC r258076, r258077:ian2013-12-141-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes 3 problems in syslogd related to sizing receive buffers... - A call was misplaced at the wrong level of nested if blocks, so that the buffers for unix domain sockets (/dev/log, /dev/klog) were never increased at all; they remained at a way-too-small default size of 4096. - The function that was supposed to double the size of the buffer sometimes did nothing, and sometimes installed a wildly-wrong buffer size (either too large or too small) due to an unitialized 'slen' variable passed to getsockopt(). Most often it doubled the UDP buffers from 40k to 80k because accidentally there would be harmless stack garbage in the unitialized variables. - The whole concept of blindly doubling a socket's buffer size without knowing what size it started at is a design flaw that has to be called a bug. If the double_rbuf() function had worked at all (I.E., if the other two bugs didn't exist) this would lead to UDP sockets having an 80k buffer while unix dgram sockets get an 8k buffer. There's nothing about the problem being solved that requires larger buffers for UDP than for unix dgram sockets -- the buffering requirements are the same regardless of socket type. This change renames the double_rbuf() function to increase_rbuf() and increases the buffer size on all types of sockets to 80k. 80k was chosen only because it appears to be the size the original change was shooting for, and it certainly seems to be reasonably large (I might have picked 64k in the absence of any historical guidance). Add ENETUNREACH and EADDRNOTAVAIL to the list of errors that are potentially transient and shouldn't result in closing the socket and giving up forever.
* syslogd: Use closefrom() instead of getdtablesize()/close() loop.jilles2013-04-271-3/+2
| | | | | | | | | | | When syslogd forks a process for '|' destinations, it closes all file descriptors greater than 2. Use closefrom() for this instead of a getdtablesize()/close() loop because it is both faster and avoids leaving file descriptors open because the limit was lowered after they were opened. MFC after: 1 week
* - Make sure that errno isn't modified before calling logerror() in errormarkj2012-12-201-1/+5
| | | | | | | | | | conditions. - Don't check for AF_INET6 when compiled without INET6 support. PR: bin/173930 Submitted by: Garrett Cooper <yanegomi@gmail.com> Approved by: rstone (co-mentor) MFC after: 1 week
* Add missing const keywords.ed2012-10-191-4/+4
|
* Add documentation for IPv6 supporteadler2012-09-121-1/+9
| | | | | | | | | PR: docs/171580 Submitted by: bdrewery Reviewed by: wblock Approved by: gjb MFC after: 1 month X-MFC-With: r240389
* Add support for ipv6 addresses as destinationbapt2012-09-121-1/+12
| | | | | | | PR: bin/150530 Submitted by: andy white <andywhite@gmail.com> Tested by: Olivier Cochard-Labbe <olivier@cochard.me> MFC after: 1 month
* Minor spelling fixes.joel2012-06-031-1/+1
|
* Update man page to present -T argument in synopsissbruno2012-03-141-1/+1
| | | | | | MFC with r183347 MFC after: 0 days
* Add a new option, -N to disable the default and recommended syslogd(8)delphij2011-07-142-8/+31
| | | | | | | | behavior, which binds to the well known UDP port. This option implies -s. MFC after: 2 months
* Here v->iov_len has been assigned the return value from snprintf.dwmalone2011-01-191-2/+3
| | | | | | | | | | | | | | Checking if it is > 0 doesn't make sense, because snprintf returns how much space is needed if the buffer is too small. Instead, check if the return value was greater than the buffer size, and truncate the message if it was too long. It isn't clear if snprintf can return a negative value in the case of an error - I don't believe it can. If it can, then testing v->iov_len won't help 'cos it is a size_t, not an ssize_t. Also, as clang points out, we must always increment v here, because later code depends on the message being in iov[5].
* This isn't WARNS=6 safe. It fails to build on mips. Retore oldimp2010-08-081-0/+2
| | | | WARNS?=3 until that's resolved.
* jh pointed out that src/usr.sbin already has a globalolli2010-08-071-2/+0
| | | | | | | | WARNS=6 setting in HEAD (unlike stable/8), so it's best to remove the line entirely. Pointed out by: jh Approved by: des (mentor)
* syslogd(8) already supports *sending* log messages to non-olli2010-08-073-9/+60
| | | | | | | | | | | | | | standard ports, but it can't *receive* them (port 514 is hardcoded). This commit adds that missing feature. (NB: I actually needed this feature for a server farm where multiple jails run with shared IP addresses, and every jail should have its own syslogd process.) As a side effect, syslogd now compiles with WARNS=6. Approved by: des (mentor) MFC after: 3 weeks
* Port all applications in usr.sbin/ from libulog to utmpx.ed2010-01-132-4/+3
|
* Let syslogd use utmpx.ed2009-12-242-27/+18
| | | | | Because strings are guaranteed to be null terminated, there is no need for excessive copying of strings, such as the line name.
* Avoid sshd, cron, syslogd and inetd to be killed under high-pressure swapattilio2009-11-251-0/+4
| | | | | | | | | | | | | | environments. Please note that this can't be done while such processes run in jails. Note: in future it would be interesting to find a way to do that selectively for any desired proccess (choosen by user himself), probabilly via a ptrace interface or whatever. Obtained from: Sandvine Incorporated Reviewed by: emaste, arch@ Sponsored by: Sandvine Incorporated MFC: 1 month
* syslog.conf(5): correct exampleavg2009-06-111-4/+4
| | | | | | | security.* and console.* are moved out of ftpd program block Approved by: jhb (mentor) MFC after: 2 weeks
* Add "crit" to the list of keywords.trhodes2008-12-231-3/+3
| | | | PR: 126934
* Constify 'name' field in struct funix. This commit makes syslogd(8)delphij2008-12-191-1/+1
| | | | | WARNS?=6 on amd64 but I have not tested under universe so keep WARNS?= level as-is for now.
* Fixing !INET6 builds after bumping WARNS to 3.avatar2008-12-181-2/+8
|
* Use passed parameter rather than the #define.obrien2008-12-171-2/+2
| | | | (more accurate extraction of Juniper Networks change)
* Rather than hardcode the 'struct iovec iov' array size, use a #define.obrien2008-12-172-11/+13
| | | | | | While I'm here bump WARNS to 3. Obtained from: Juniper Networks
* Use "allowed_peer" throughout this manual page.trhodes2008-12-071-2/+3
|
* Add a flag, -T, that tells syslogd to always replace the timestamp ondwmalone2008-09-252-7/+24
| | | | | | | | | | messages from the network. We already replace malformatted timestamps and this option lets us replace timestamps that are correctly formatted but wrong. PR: 120891 Submitted by: Thomas Vogt <thomas@bsdunix.ch> MFC after: 1 week
* Remove extraneous NULL pointer check - the pointer is guaranteed to be non-NULL.obrien2008-09-011-2/+1
|
* Allow comment to be placed at the end of a configuration line.sobomax2008-07-092-0/+25
| | | | MFC after: 2 weeks
* Add a -8 switch to syslogd to prevent it from mangling 8-bit data.brian2008-05-142-5/+26
|
* Two no-op fixes to improve corretness of syslogd code:dwmalone2008-02-201-3/+4
| | | | | | | | | | | 1) Use [AP]F_LOCAL rather than [AP]F_UNIX. 2) When copying a pipe's name, use f->f_un.f_pipe.f_pname, not f->f_un.f_fname. PR: 20889 Submitted by: Damieon Stark PR: 116642 Submitted by: Jim Pirzyk Reviewed by: md5
* + Open ctty in non-blocking mode to avoid hangs during open and close(waitingobrien2007-12-111-9/+20
| | | | | | | | | | | | | | for the port to drain). + Handle "*" as a priority properly. + Test what is free'ed. + Dynamically determine length vs. hardcoding it. + Free the previous message buffer (f_prevline) only after logging all the messages and just before the process exit. Also check f_prevline for NULL before using it. + The time displayed is not synchornized with the other log destinations. + Fix a comment. Obtained from: Juniper Networks
* style(9)obrien2007-12-051-15/+15
|
* Mark up keywords with .Cm.trhodes2006-10-121-5/+11
| | | | | | PR: 95039 Sumitted by: SeaD (older version) Reviewed by: ru
* Markup fixes.ru2006-09-291-2/+3
|
* Sync usage() with manpage's SYNOPSIS.ru2006-09-291-2/+2
|
* Obey MK_INET6_SUPPORT.yar2006-07-271-1/+8
|
* Add the ability to log to an arbitrary udp port as well as thejulian2006-04-172-6/+43
| | | | | standard syslog port. This allows syslog to easily export lines of interest to an external logging system.
* Currently, if writing out a log entry fails, we unlink that log entry from ourcsjp2006-03-301-5/+12
| | | | | | | | | | | | internal list of logfiles. So if writev(2) fails for potentially transient errors like ENOSPC, syslogd requires a restart, even if the filesystem has purged. This change allows syslogd to ignore ENOSPC space errors, so that when the filesystem is cleaned up, syslogd will automatically start logging again without requiring the reset. This makes syslogd(8) a bit more reliable. MFC after: 1 week
* By default (for security reasons) syslogd(8) doesn't create log filespjd2006-03-062-5/+14
| | | | | | | | | | | | when they don't exist, but sometimes its quite useful (eg. we use non-standard log files and memory backed /var/, which is populated on boot). Add -C option which tells syslogd(8) to create log files if they don't exist. Glanced at by: phk MFC after: 3 days
* Fix typojulian2006-02-231-1/+1
|
* style(9) nitlet:imp2005-10-171-1/+2
| | | | | | | | | | | foo() { } to foo() { }
* setsockopt() will return -1 on error, not 0.cognet2005-09-281-1/+1
| | | | Pointy hat to: Jeremie Le Hen
* Use SO_REUSEADDR on the socket, to make the use of syslogd in jails easier.cognet2005-09-281-1/+7
| | | | Submitted by: Jeremie Le Hen <jeremie le-hen org>
* Use pidfile(3) in syslogd(8).pjd2005-08-241-9/+16
|
* Fix all the spelling mistakes I could find in the man pages for wordskeramida2005-07-311-1/+1
| | | | | | | | that have at least 3 characters. MFC after: 1 week Thanks to: Music band ``Chingon'' for keeping me company while searching for these.
* Add cases for ENOBUFS and ENETDOWN. We need to make sure that wecsjp2005-05-191-0/+2
| | | | | | | | | catch all transient errors. This fixes situations where transient error conditions such as network interfaces losing carrier signals or the system running out of mbufs would result in the permanent removal of forwarding syslog messages. MFC after: 1 week
* NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 definesume2005-05-131-17/+5
| | | | | NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special for it, now.
* Add -S option which allows to change the pathname of the privilegedhrs2005-04-132-2/+11
| | | | | | | socket /var/run/logpriv. Reviewed by: glebius and kensmith MFC after: 2 days
* Check that supplied facility is not bigger than LOG_NFACILITIES.glebius2005-03-281-0/+7
| | | | | PR: bin/79260 Submitted by: Shuichi KITAGUCHI
* Expand contractions.ru2005-02-131-2/+2
|
* Expand *n't contractions.ru2005-02-132-3/+3
|
* Sort sections.ru2005-01-181-21/+21
|
OpenPOWER on IntegriCloud