Commit Graph

228 Commits

Author SHA1 Message Date
Ed Schouten
b5810e9449 Port all applications in usr.sbin/ from libulog to utmpx. 2010-01-13 18:17:53 +00:00
Ed Schouten
2734cf8c82 Let syslogd use utmpx.
Because strings are guaranteed to be null terminated, there is no need
for excessive copying of strings, such as the line name.
2009-12-24 18:05:33 +00:00
Attilio Rao
7a7043c787 Avoid sshd, cron, syslogd and inetd to be killed under high-pressure swap
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
2009-11-25 15:12:24 +00:00
Andriy Gapon
5cd1d3ff17 syslog.conf(5): correct example
security.* and console.* are moved out of ftpd program block

Approved by:	jhb (mentor)
MFC after:	2 weeks
2009-06-11 18:42:31 +00:00
Tom Rhodes
5b34e7083c Add "crit" to the list of keywords.
PR:		126934
2008-12-23 17:39:24 +00:00
Xin LI
7ad0654cff Constify 'name' field in struct funix. This commit makes syslogd(8)
WARNS?=6 on amd64 but I have not tested under universe so keep WARNS?=
level as-is for now.
2008-12-19 18:27:51 +00:00
Tai-hwa Liang
2db461e489 Fixing !INET6 builds after bumping WARNS to 3. 2008-12-18 04:03:29 +00:00
David E. O'Brien
58a841efc2 Use passed parameter rather than the #define.
(more accurate extraction of Juniper Networks change)
2008-12-17 16:55:58 +00:00
David E. O'Brien
97f37b322d Rather than hardcode the 'struct iovec iov' array size, use a #define.
While I'm here bump WARNS to 3.

Obtained from:	Juniper Networks
2008-12-17 16:51:40 +00:00
Tom Rhodes
efe78a46f7 Use "allowed_peer" throughout this manual page. 2008-12-07 18:45:30 +00:00
David Malone
cfcf794e5f Add a flag, -T, that tells syslogd to always replace the timestamp on
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
2008-09-25 09:28:18 +00:00
David E. O'Brien
16d2cd9432 Remove extraneous NULL pointer check - the pointer is guaranteed to be non-NULL. 2008-09-01 15:10:03 +00:00
Maxim Sobolev
7e1535c571 Allow comment to be placed at the end of a configuration line.
MFC after:	2 weeks
2008-07-09 07:37:54 +00:00
Brian Somers
d7022add17 Add a -8 switch to syslogd to prevent it from mangling 8-bit data. 2008-05-14 00:22:21 +00:00
David Malone
6f540420dd Two no-op fixes to improve corretness of syslogd code:
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
2008-02-20 21:54:41 +00:00
David E. O'Brien
e7ec0d579b + Open ctty in non-blocking mode to avoid hangs during open and close(waiting
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
2007-12-11 06:10:10 +00:00
David E. O'Brien
817a9ffcc4 style(9) 2007-12-05 18:00:41 +00:00
Tom Rhodes
42c3aae2ea Mark up keywords with .Cm.
PR:		95039
Sumitted by:	SeaD (older version)
Reviewed by:	ru
2006-10-12 01:59:34 +00:00
Ruslan Ermilov
bc84aa4ba3 Markup fixes. 2006-09-29 17:57:04 +00:00
Ruslan Ermilov
b3e2f7a6d8 Sync usage() with manpage's SYNOPSIS. 2006-09-29 17:36:38 +00:00
Yaroslav Tykhiy
6884810944 Obey MK_INET6_SUPPORT. 2006-07-27 14:52:12 +00:00
Julian Elischer
be389c75f0 Add the ability to log to an arbitrary udp port as well as the
standard syslog port. This allows syslog to easily export lines of interest to
an external logging system.
2006-04-17 20:12:35 +00:00
Christian S.J. Peron
ae4f0fc3a9 Currently, if writing out a log entry fails, we unlink that log entry from our
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
2006-03-30 21:04:52 +00:00
Pawel Jakub Dawidek
c503ddf2cc By default (for security reasons) syslogd(8) doesn't create log files
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
2006-03-06 10:36:33 +00:00
Julian Elischer
f47dba63bb Fix typo 2006-02-23 18:51:02 +00:00
Warner Losh
327608b266 style(9) nitlet:
foo() {
}

to

foo()
{
}
2005-10-17 16:51:06 +00:00
Olivier Houchard
c825862e6c setsockopt() will return -1 on error, not 0.
Pointy hat to:	Jeremie Le Hen
2005-09-28 16:14:43 +00:00
Olivier Houchard
20c0b2d3c3 Use SO_REUSEADDR on the socket, to make the use of syslogd in jails easier.
Submitted by:   Jeremie Le Hen <jeremie le-hen org>
2005-09-28 16:05:13 +00:00
Pawel Jakub Dawidek
fa39391686 Use pidfile(3) in syslogd(8). 2005-08-24 17:26:26 +00:00
Giorgos Keramidas
6fb9b618f5 Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after:	1 week
Thanks to:	Music band ``Chingon''
		for keeping me company while searching for these.
2005-07-31 03:30:48 +00:00
Christian S.J. Peron
8e56d2ee05 Add cases for ENOBUFS and ENETDOWN. We need to make sure that we
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
2005-05-19 21:09:44 +00:00
Hajimu UMEMOTO
4f10131848 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +00:00
Hiroki Sato
15f3d79b55 Add -S option which allows to change the pathname of the privileged
socket /var/run/logpriv.

Reviewed by:	glebius and kensmith
MFC after:	2 days
2005-04-13 03:19:41 +00:00
Gleb Smirnoff
b4e852907f Check that supplied facility is not bigger than LOG_NFACILITIES.
PR:		bin/79260
Submitted by:	Shuichi KITAGUCHI
2005-03-28 10:59:19 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
59a3c79da6 Sort sections. 2005-01-18 20:02:45 +00:00
Ruslan Ermilov
1a74e6a157 Scheduled mdoc(7) sweep. 2005-01-11 11:47:22 +00:00
David Malone
f56bb70ae6 Allow ':' and '%' in hostname specifications so that we can specify IPv6
addresses and scope IDs.

MFC after:	3 weeks
2004-12-28 22:25:04 +00:00
David Malone
62f29f306a Some syslog messages delimit the program tag with whitespace rather
than a colon, so don't allow whitespace in program names. To be
consistent with hostnames, don't allow whitespace in the program
name specifiers in syslog.conf either.

(The first change is by Markus from the PR, the second is mine.)

PR:		68691
Submitted by:	Markus Oestreicher <m.oe@x-trader.de>
MFC after:	3 weeks
2004-12-28 21:58:54 +00:00
Gleb Smirnoff
204d318009 s/priveleged/privileged/ 2004-11-18 13:37:33 +00:00
Giorgos Keramidas
d6c85264cd Fix a minor comment typo: priveleged = privileged. 2004-11-18 12:20:52 +00:00
Ruslan Ermilov
a7c23514f6 Really revert the whitespace change to usage(). 2004-11-11 18:09:00 +00:00
Gleb Smirnoff
24f3d18aa1 Change TABs back to spaces in usage string constants.
Requested by:	ru
2004-11-11 16:13:10 +00:00
Gleb Smirnoff
033b92f386 Whitespace.
Approved by:	cvs diff -b
2004-11-11 09:41:03 +00:00
Gleb Smirnoff
43af2cc4a5 Double receive buffer size on sockets.
PR:		bin/72366
Ok'd by:	dwmalone
Approved by:	julian (mentor)
Obtained from:	OpenBSD
MFC after:	1 month
2004-11-11 09:39:04 +00:00
Ken Smith
de655741ce Bump document date.
Noticed by:     trhodes
Pointy hat:     kensmith
MFC after:      1 week
2004-11-09 04:41:12 +00:00
Ken Smith
83d71f6175 Add newsyslog(8) to the "See Also" section.
MFC after:	1 week
2004-11-09 04:31:31 +00:00
Gleb Smirnoff
240d5a9b1c Protect against local flooder of /var/run/log. Do not loop forever in
syslog(3) if we are a priveleged program (sshd, su, etc.).

- Make syslogd open an additional socket /var/run/logpriv, with 0600
  permissions.
- In libc, try to use this socket.
- Do not loop forever if we are using this socket (partial backout of 1.31)

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
MFC after:	1 month
2004-11-04 23:09:57 +00:00
Gleb Smirnoff
247444670e - Use stailqueue for sockets instead of socket buffer. Thus
remove limit for 20 sockets.
- Add possibility to specify file mode for sockets created with '-l'.
- Check that socket name in '-l' is absolute.

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
2004-11-04 22:20:21 +00:00