summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed the free(3) panic overlooked due to the -Wno-uninitialized.ru2001-09-111-1/+2
|
* - Silence warnings: apply `const' generously, mark some variablesdd2001-09-091-44/+48
| | | | | | | | | | | | | | | __unused, and change local variables named `sin' (struct sockaddr_in) to `sin4'. (`sin' conflicts with the definition of sin(3), which gcc assumes to be defined even if math.h isn't included (it's a builtin). This is probably a bug in gcc.) - Apply WARNS=1. WARNS=2 was not used because this program assigns string literals to (struct iovec).iov_base for writing, and the only clean way to silence -Wwrite-strings in that case would be to strdup() and consequently free() those literals, which I considered too disruptive. Reviewed by: bde (partially)
* Correct a last minute sizeof() bogon in my previous commit.kris2001-09-051-1/+1
|
* Introduce a -b option that allows the user to specify which address todd2001-09-011-5/+11
| | | | | | | bind to. This is useful for hosts running jails that need syslog to maintain an open socket to log to a remote host. Reviewed by: sheldonh
* Fix some unsafe signal handlers, and be careful not to overflow on fd_set.kris2001-09-011-102/+136
| | | | | | | | Fix some string buffer operations. Based on: OpenBSD Reviewed by: audit MFC after: 2 weeks
* Gives syslogd(8) the ability to refresh its idea of the hostname ofcjc2001-08-271-7/+27
| | | | | | | | | | | the system on which it is running. The hostname is reloaded when 'HUPped' and a log message generated to note a change (before anyone points it out, this is not an added security feature). PR: bin/24444 Reviewed by: freebsd-audit Approved by: ru MFC after: 2 weeks
* Handle snprintf() returning -1.brian2001-08-201-2/+5
| | | | MFC after: 2 weeks
* - `-a' option for IPv6 was not working correctly.ume2001-07-191-4/+9
| | | | | | | | - Lose any stray host bits that a user may have entered when providing a network number and netmask to the `-a' option for IPv6. This is corresponding to 1.79 that is for IPv4 only. MFC after: 1 week
* Lose any stray host bits that a user may have entered when providingcjc2001-07-021-1/+3
| | | | | | | a network number and netmask to the '-a' option. Approved by: ru MFC after: 1 week
* Fix constness warning introduced in syslog.h 1.21.dwmalone2001-05-211-2/+2
|
* Add the ability to specify alternate PID file for syslogd.dwmalone2001-05-101-3/+6
| | | | | | PR: 25784 Submitted by: Jon Villarreal <jonv@ivmg.net> Reviewed by: iedowse
* MAXHOSTNAMELEN includes the NULbrian2001-03-091-5/+5
|
* This seems to stop syslog console messages looping. The problemdwmalone2001-02-041-1/+1
| | | | | | is that LOG_FAC doesn't do quite what you think it does. PR: 24704
* IPv6 support for syslogd.ume2000-12-161-140/+387
| | | | | Reviewed by: freebsd-current Obtained from: NetBSD
* Add the "LOG_CONSOLE" facility and tell syslogd to not log it onphk2000-11-251-0/+2
| | | | console devices.
* Syslogd normally converts messages of facility kern to facilitydwmalone2000-10-171-2/+6
| | | | | | | | | | user unless they come directly from the kernel. Document this and add a flag to syslogd which prevents this conversion. Sort getopt args while I'm at it. PR: 21788 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
* Fix unexploitable off by one error as mentioned on Bugtraq.imp2000-09-191-2/+1
|
* Update the usage string to reflect -n as an option.ps2000-08-071-1/+1
|
* Actually make syslogd understand the new -n option by putting itps2000-08-071-1/+1
| | | | | | in getopt. Submitted by: Clive Lin <clive@CirX.ORG>
* Sort cases in getopt switch statement.dwmalone2000-08-031-31/+32
| | | | | | | | | | Remove extra parens from my host selection commit. Add white space after if, while, for and switch. Get rid of braces around a single statement if. There should be no functional changes in this commit. Reviewed by: sheldonh
* Replace two calls to strlen+calloc+strcpy with strdup.dwmalone2000-08-031-12/+4
| | | | Reviewed by: sheldonh
* Change option -r to -n inline with conventions we use elsewhere.ps2000-07-291-3/+3
| | | | | | | I guess it serves me right for using a patch directly from Jan Koum. :) Requested by: many
* Add option 'r' to syslogd which will disable dns queries for everyps2000-07-291-3/+10
| | | | | | | request. This is useful when you have a large site pointed at a single syslog server. Submitted by: Jan Koum <jkb@yahoo-inc.com>
* Allow syslogd to select messages based on the originating host indwmalone2000-07-241-7/+51
| | | | | | | | | | | | | | | | a similar way to the way it can select messages from a given program. Lines beginning with "+hostname" or "#+hostname" select messaes from that hostname and lines beginning with "-hostname" or "#-hostname" match messages not from that hostname. There are some significant style issues left in the original program selection code and the man page. This should be cleared up in some later commits. Reviewed by: sheldonh Based on an original patch by: Bernd Walter <ticso@cicely8.cicely.de> Man page stylist: sheldonh
* Prevent a non-exploitable remote buffer overflow.kris2000-06-081-3/+3
| | | | | | Reported by: twitch <twitch@vicar.org> Submitted by: Guido van Rooij <guido@gvr.org> Reviewed by: security-officer
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Enable 8bit chars excepting high controlsache2000-04-181-4/+10
|
* Fix a nit in my previous commit: make SIGHUP and SIGCHLD restartablejoerg2000-02-291-2/+2
| | | | | | | | as they ought to be. The description of SA_RESTART was a little unobvious to me in the man page, so i missed it. Thanks to Bruce for spotting this. Submitted by: bde
* Fix a serious bug in syslogd regarding the handling of pipes. The bugjoerg2000-02-281-35/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | would cause syslogd to eventually kill innocent processes in the system over time (note: not `could' but `would'). Many thanks to my colleague Mirko for digging into the kernel structures and providing me with the debugging framework to find out about the nature of this bug (and to isolate that syslogd was the culprit) in a rather large set of distributed machines at client sites where this happened occasionally. Whenever a child process was no longer responsive, or when syslogd receives a SIGHUP so it closes all its logging file descriptors, for any descriptor that refers to a pipe syslogd enters the data about the old logging child process into a `dead queue', where it is being removed from (and the status of the dead kitten being fetched) upon receipt of a SIGCHLD. However, there's a high probability that the SIGCHLD already arrives before the child's data are actually entered into the dead queue inside the SIGHUP handler, so the SIGCHLD handler has nothing to fetch and remove and simply continues. Whenever this happens, the process'es data remain on the dead queue forever, and since domark() tried to get rid of totally unresponsive children by first sending a SIGTERM and later a SIGKILL, it was only a matter of time until the system had recycled enough PIDs so an innocent process got shot to death. Fix the race by masking SIGHUP and SIGCHLD from both handlers mutually. Add additional bandaids ``just in case'', i. e. don't enter a process into the dead queue if we can't signal it (this should only happen in case it is already dead by that time so we can fetch the status immediately instead of deferring this to the SIGCHLD handler); for the kill(2) inside domark(), check for an error status (/* Can't happen */ :) and remove it from the dead queue in this case (which if it would have been there in the first place would have reduced the problem to a statistically minimal likelihood so i certainly would never have noticed the bug at all :). Mirko also reviewed the fix in priciple (mutual blocking of both signals inside the handlers), but not the actual code. Reviewed by: Mirko Kaffka <mirko@interface-business.de> Approved by: jkh
* Add section number to .Xr. Use .Pa for filenames.charnier2000-01-231-3/+2
| | | | fprintf -> warnx.
* Do this the Right Way (tm), i.e. use shutdown() instead of fooling arounddes2000-01-141-6/+2
| | | | | | with the size of the receive buffer. Pointed out by: ru
* Slight change of secure mode semantics: instead of reading (and counting)des2000-01-141-13/+16
| | | | | | | | | vogons, set the size of the receive buffer to 1 and rely on the kernel to simply drop incoming packets. The logging code was buggy anyway. Use socklen_t instead of int for the length argument to recvfrom. Add a 'continue' at the end of a loop for ANSI conformance.
* Fix page fault in -vv mode.ru2000-01-131-2/+2
| | | | | | PR: 16098 Submitted by: Alan.Judge@indigo.ie Reviewed by: ru
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Make hostname comparisons case insensitivebrian1999-08-171-4/+5
|
* readklog(): rename variable 'l' to 'len', to avoid possible confusion with 'i'dt1999-05-061-11/+11
| | | | | | and '1'. Requested by: mckay
* Is there a limit to how stupid I can get?des1999-05-041-2/+2
|
* Little fix in previous: watch NUL-termination.dt1999-05-021-2/+2
|
* Fight with false newlines in kernel message logs. Output a line into log onlydt1999-05-021-37/+64
| | | | | after we read a newline, or we have nothing to read from /dev/klog. Read /dev/klog in non-blocking mode.
* Implement fascist mode (do not open a datagram socket at all).des1999-04-301-3/+4
|
* Ensure a terminating null when processing hostname strings fromcwt1998-12-291-4/+7
| | | | | arbitrary sources. Obtained from: OpenBSD
* Accept "!*" as a valid all-programs tag line as documented.cwt1998-12-291-2/+2
| | | | | PR: 8447 Submitted by: Gaspar Chilingarov <nightmar@lemming.acc.am>
* Block SIGHUP during call to gethostbyaddr().cwt1998-12-281-1/+6
| | | | | | PR: 5548 Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Obtained from: OpenBSD
* Allow either tabs or spaces in configuration files.jkh1998-12-041-8/+8
| | | | | PR: 8762 Submitted by: Igor Roshchin <str@giganda.komkon.org>
* When warning about discarding packets in secure mode, include the IPdg1998-11-051-2/+3
| | | | address of the most recent offender.
* Submitted by: archie@whistle.comjulian1998-08-251-3/+3
| | | | quieten cc -Wall
* Harlan.Stenn@pfcs.com added two (very interesting) options to syslogd forphk1998-07-271-3/+3
| | | | | | | | | | -current (Thanks Harald). However, on my attempt to try this on -STABLE, I found that when forwarding to another host the actual messages gets lost. This is due to a wrong index because when the -v option was added, the indexes shifted one place. PR: 7407 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
* Add -u, -v and -vv options to syslogd, this improves the control andphk1998-07-221-12/+108
| | | | | | | logging verbosity about facility & priority levels. PR: 7278 Reviewed by: phk Submitted by: Harlan Stenn <Harlan.Stenn@pfcs.com>
* Fixed printf format errors.bde1998-07-061-2/+2
|
OpenPOWER on IntegriCloud