Commit Graph

133 Commits

Author SHA1 Message Date
Maxim Konovalov
e1178b3b9d Remove unnecessary setjmp.h.
Reviewed by:	ru
Approved by:	ru
Obtained from:	OpenBSD
MFC after:	1 week
2002-02-13 08:49:29 +00:00
Maxim Konovalov
191c304372 Unlink all log sockets at startup.
PR:		misc/34839
Reviewed by:	ru
Approved by:	ru
Obtained from:	OpenBSD
MFC after:	2 weeks
2002-02-13 08:37:55 +00:00
Ruslan Ermilov
8c9d547186 mdoc(7) police: add missing markup bit. 2002-01-10 15:16:58 +00:00
Daniel Eischen
8da986febb Initialze a stack variable with NULL to unbreak buildworld with -Wall.
I don't know about anyone else, but the compiler was always aborting
on this stupid warning, and has been doing so for weeks.
2002-01-09 17:36:53 +00:00
Archie Cobbs
3a0ac99551 Add a new flag '-c' to disable repeated line compression when the output
is a pipe to another program, or, if specified twice, in all cases.

PR:	bin/32420
2002-01-05 07:34:52 +00:00
Ruslan Ermilov
d3f58d4008 mdoc(7) police: markup nits. 2001-12-08 16:17:49 +00:00
Dima Dorfman
a53dffb774 Make the default kernel prefix "kernel:" instead of the boot file,
with the old behavior available via the -o option (it might still be
useful if one has many kernels and cares which messages came from
which).  If the boot file is not used as the prefix, it is still
logged once at startup.

This change is prompted by the fact that the boot file is now much
longer ("/boot/kernel/kernel" vs. "/kernel"), which significanlty
bloats the syslogd output.

Reviewed by:	peter
2001-11-27 20:02:18 +00:00
Paul Saab
4741693c8e If the mask length is zero, there is no need to convert it to a
netmask.

PR:		31947
Submitted by:	Aaron Scarisbrick <aaronsca@hotmail.com>
MFC after:	1 week
2001-11-14 09:20:24 +00:00
Dag-Erling Smørgrav
46ae3bbfea Check the return values from calls to malloc(), calloc(), strdup() etc.
Submitted by:	Philippe Charnier <charnier@xp11.frmug.org>
MFC after:	2 weeks
2001-09-30 16:09:17 +00:00
Dag-Erling Smørgrav
f28f539f3c Add a strcasecmp() call I forgot in my hurry to commit the previous fix.
Without this call, the hostname check would in some cases yield false
positives.

Pointed out by:	ru
2001-09-13 09:40:35 +00:00
Dag-Erling Smørgrav
db87d61acf The previous commit appeared to just shove the bug under the carpet rather
than really solve it.  This approach (inspired by Ruslan's patch) solves
the real problem by stripping the local domain off the host name in the
config line structure.

Also mark a bunch of code sections that either do not check the return value
of a strdup(), malloc() or calloc() call, or do not properly handle a NULL
return.
2001-09-13 06:48:41 +00:00
Dag-Erling Smørgrav
a5cc8abe03 Fix logging from remote hosts, which has been broken since (at least) revision
1.64, i.e. July of last year.  Also fix a minor style bug in the same code.

PR:		bin/28634
Pointy hat to:	dwmalone
Pointed out by:	my buggy DSL router's remote logging facility
2001-09-13 05:09:14 +00:00
Ruslan Ermilov
7e848a7014 Fixed the free(3) panic overlooked due to the -Wno-uninitialized. 2001-09-11 08:18:04 +00:00
Dima Dorfman
df755a4837 Use CFLAGS instead of COPTS. 2001-09-09 14:30:36 +00:00
Dima Dorfman
d3ca0b131b - Silence warnings: apply `const' generously, mark some variables
__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)
2001-09-09 14:25:02 +00:00
Kris Kennaway
7e2f1d04d8 Correct a last minute sizeof() bogon in my previous commit. 2001-09-05 05:20:31 +00:00
Dima Dorfman
f676ae2b46 Introduce a -b option that allows the user to specify which address to
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
2001-09-01 08:42:49 +00:00
Kris Kennaway
dc2bdcbddf Fix some unsafe signal handlers, and be careful not to overflow on fd_set.
Fix some string buffer operations.

Based on:	OpenBSD
Reviewed by:	audit
MFC after:	2 weeks
2001-09-01 07:57:35 +00:00
Crist J. Clark
7ae71655e7 Fix some small errors and markup nits.
Approved by:	ru
MFC after:	2 days
2001-08-28 19:10:51 +00:00
Crist J. Clark
ba1cc9067d Gives syslogd(8) the ability to refresh its idea of the hostname of
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
2001-08-27 21:37:15 +00:00
Dima Dorfman
9e5726611c Don't make it sound like -A is turning on the default behavior. 2001-08-27 11:04:09 +00:00
Brian Somers
36c1612b5e Handle snprintf() returning -1.
MFC after:	2 weeks
2001-08-20 13:24:39 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
David E. O'Brien
90e655ea4e Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
2001-07-20 06:20:32 +00:00
David E. O'Brien
ac24b049cc Remove GCC'isms in CFLAGS. 2001-07-20 04:23:13 +00:00
Hajimu UMEMOTO
74fd29e0bc - `-a' option for IPv6 was not working correctly.
- 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
2001-07-19 22:04:09 +00:00
Mike Barcroft
e3608b7813 Document the fact that syslogd(8) requires logs files to be created
before it will start logging to them.

PR:		27088
Approved by:	des
MFC after:	10 days
2001-07-18 13:31:08 +00:00
Dima Dorfman
f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Ruslan Ermilov
a4c37c816b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:12:08 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Crist J. Clark
6ca048f825 Lose any stray host bits that a user may have entered when providing
a network number and netmask to the '-a' option.

Approved by:	ru
MFC after:	1 week
2001-07-02 15:26:47 +00:00
Ruslan Ermilov
be5c8032a0 Note that -a is ignored if -s is also specified. 2001-06-06 12:48:22 +00:00
David Malone
38f612a1e6 Fix constness warning introduced in syslog.h 1.21. 2001-05-21 22:13:55 +00:00
Ruslan Ermilov
8fcaaa2e12 mdoc(7) police: uppercase abbreviations in revision 1.34. 2001-05-16 09:43:48 +00:00
David Malone
f0ee959841 Add the ability to specify alternate PID file for syslogd.
PR:		25784
Submitted by:	Jon Villarreal <jonv@ivmg.net>
Reviewed by:	iedowse
2001-05-10 15:48:33 +00:00
Ruslan Ermilov
90b4a69f41 mdoc(7) police: removed hard sentence break. 2001-04-04 11:33:01 +00:00
Chris Timmons
5c620e2dad Document LOG_CONSOLE. 2001-03-27 19:55:53 +00:00
Ruslan Ermilov
345e52e742 - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:42:20 +00:00
Brian Somers
e47bf70d00 MAXHOSTNAMELEN includes the NUL 2001-03-09 21:24:13 +00:00
Ruslan Ermilov
bcdf5ca7c6 Prepare for mdocNG. 2001-02-26 09:05:48 +00:00
David Malone
8bc588fa15 This seems to stop syslog console messages looping. The problem
is that LOG_FAC doesn't do quite what you think it does.

PR:		24704
2001-02-04 15:16:08 +00:00
Ruslan Ermilov
610a5778c5 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:44:04 +00:00
Ruslan Ermilov
8b5c4af3ff Prepare for mdoc(7)NG. 2000-12-27 15:30:30 +00:00
Ruslan Ermilov
e0b32a7704 mdoc(7) police: document IPv6 options in the SYNOPSIS. 2000-12-18 08:42:58 +00:00
Hajimu UMEMOTO
3881628990 IPv6 support for syslogd.
Reviewed by:	freebsd-current
Obtained from:	NetBSD
2000-12-16 18:25:48 +00:00
Poul-Henning Kamp
ea250e5b03 Add the "LOG_CONSOLE" facility and tell syslogd to not log it on
console devices.
2000-11-25 21:00:58 +00:00
Ruslan Ermilov
e97407b4f2 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 20:10:44 +00:00
David Malone
481a19023e Syslogd normally converts messages of facility kern to facility
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>
2000-10-17 10:19:42 +00:00
David Malone
bcfe1db87d Fix spelling of comparison. 2000-10-17 10:14:51 +00:00
Alfred Perlstein
39e31cdb6a Add forgotten -n option to SYNOPSIS section
Submitted by: Reinier Bezuidenhout <rbezuide@oskar.nanoteq.co.za>
2000-09-23 22:38:56 +00:00