Commit Graph

66 Commits

Author SHA1 Message Date
ad a90951c0f1 Xr newsyslog. 2000-07-11 12:43:50 +00:00
jwise ea7e9f5176 Fix minor thinko in previous. Make sure we close and keep closed all
sockets in the situation where all of the following are true:

	* /etc/syslogd.conf contained forwarding actions when we were
	  started up or when we last received a HUP

	* /etc/syslogd.conf has had all forwarding actions removed

	* we are running with -s

and we receive a HUP.
2000-07-02 02:15:34 +00:00
jwise 37b8137c99 Remove caveat about behavior of `syslogd -s' when forwarding rules are
present -- this behavior has been fixed.
2000-06-30 18:52:24 +00:00
jwise 9b22831fbc Fix opening/closing of sockets when receiving a HUP, and /etc/syslog.conf
has been changed from having forwarding actions to having none, or vice versa.
2000-06-30 18:45:04 +00:00
jwise ccb04760be Improve behavior of `syslogd -s'.
Even if we are forwarding, don't bind to udp/514 if running with `-s'.
2000-06-30 18:22:54 +00:00
jwise 20abf1785a Back out and redo previous at Bill Sommerfeld's <sommerfeld@netbsd.org>
request:

	instead of the -S flag, fix the -s flag to not open a socket
	if there are no forwarding rules in /etc/syslog.conf

The behavior of syslogd when -s is specified and there are forwarding rules
should still be made cleaner.
2000-06-30 18:03:50 +00:00
jwise 3258a51b03 1.) bring usage text up to date, and clarify description of `-s' option
in man page and comments -- for some time it has no longer prevents
    an inet socket from being opened, just caused it to be ignored

2.) Fix this problem with `-s' -- syslogd always opens an inet socket, even if
    -s is specified and it has nowhere to send to.  This socket is then
    shutdown(), but there is no way to not have this socket open.

    Users setting up paranoid installations can now specify `-S' which
    prevents any non-unix-domain sockets from being opened, even if
    forwarding is specified in /etc/syslogd.conf.

    As per the previous fix, this is not made the default for `-s', as it
    also prevents syslogd from forwarding log messages.

3.) document the above in the man page and usage.

Justification:  in light of the possibility of future DoS attacks, or the
desire to set up a machine which is relatively uninformative in the face
of port scans, users may quite legitimately want to control what sockets
are open on their machine.  Telling such users that they cannot run
syslogd is non-ideal.
2000-06-30 17:32:43 +00:00
kim 13cec62a32 The "ftp" facility was not listed. 2000-04-12 16:38:58 +00:00
lukem 315a29d6de * in secure mode (-s), still open the inet sockets but do a shutdown(,SHUT_RD)
on each of them, and don't bother listening on them. this allows messages
  to be forwarded even with -s enabled.

  XXX: not 100% sure if this is susceptable to a DoS, e.g someone filling
  up kernel buffers with a backlog of packets not being read, but shutdown(2)
  should prevent that even if it possibly doesn't at this time.

* minor KNF
2000-02-18 09:44:46 +00:00
itojun af2a74fdec use sizeof(foo) instead of hardcoded value, to help synchronizing
variable def and function parameter.
1999-12-13 04:25:08 +00:00
ad 8ad73e9274 RCSID police. 1999-12-07 11:30:27 +00:00
itojun 4ba0077ac0 be more friendly with non-IPv6 kernel. 1999-12-06 01:26:26 +00:00
itojun 9d1c5f0b5c IPv6 support in syslogd. actually we need library update as well.
NetBSD PR #8934 from Feico Dillema <dillema@acm.org> (with memory leak fix).
1999-12-02 16:17:29 +00:00
ad 73f0c424f5 - Fix location of RCS Id string.
- It's now syslogd.pid, not syslog.pid.
1999-11-30 12:08:49 +00:00
mrg 6663793e96 add some debug messages. 1999-11-27 14:51:49 +00:00
simonb fd8040a031 s/acknowledgment/acknowledgement/ 1999-09-10 03:24:14 +00:00
lukem b04ab05ddd save/restore errno as necessary (printf() et al might have modified it...) 1999-06-07 15:34:07 +00:00
thorpej 78688ba793 Use pidfile(3). 1999-06-06 01:50:23 +00:00
garbled d1407362ba More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:43:46 +00:00
perry 45d01efb13 /var/run/log. 1999-03-19 00:53:31 +00:00
perry 98c39393e3 symlink /var/run/log to /dev/log for transition period. 1999-03-19 00:43:03 +00:00
is 908cc38079 /dev/log moved to /var/run/syslog.socket. 1999-03-15 17:01:00 +00:00
mycroft d77575d3c8 Clean up SYNOPSIS formatting. 1999-03-07 11:58:22 +00:00
tron f41d893cec Because the old bound check is used at several places we need to make
sure that the array is really NULL terminated. Fixes PR bin/7062.
1999-02-28 11:46:26 +00:00
pk 4bcb8b3a48 Correct precedence in calculation of storage for pollfds. 1999-02-28 11:30:18 +00:00
tron 925f506372 - Don't use static array hack if neither "-p" nor "-P" are used.
- Because the logsocket array is not NULL terminated use the entry number
  for bound checks.
1999-02-28 11:16:18 +00:00
tron c87ec3954b Use correct expression "sizeof(char *)" instead of "sizeof(char **)"
to calculate memory size.
1999-02-28 11:03:35 +00:00
mrg 19ef5d758f - allow -p /log/socket to appear more than once (and work as expected
if given this).  this is extremely useful for chrooted daemons that
  still want to create log entries via a local mechanism.

- create a new -P option that takes a filename of log sockets (equiv.
  of calling syslogd which -p <each line of file>.  this is useful
  for the case of many chroot areas and keeping this information in
  one place rather than having to remember it all.

if no -p options are given, the default (_PATH_LOG) is used as normal.
1999-02-21 13:30:15 +00:00
tron 0ffcc8e911 Use "[host]: " as prefix for forwarded messages to distinguish them
from message originated by the forwarding host, fixes PR bin/5860 by
Greg A. Woods.
1998-07-30 23:29:29 +00:00
lukem 786b86d71b use AF_LOCAL instead of AF_UNIX 1998-07-18 05:04:35 +00:00
mrg 32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
kleink f6c179f10e Fix arithmetics lossage on typeless pointers. 1998-05-08 19:03:41 +00:00
fair dc026e0515 Change occurrences of "UNIX" to .Ux or .At as appropriate. 1998-04-28 06:00:51 +00:00
mrg 8a1743897f nit: order rcsid/sccsids 1998-02-10 03:50:24 +00:00
mrg bc13fc9251 prefer snprintf() to sprintf() 1997-10-24 01:41:47 +00:00
lukem f5bf267d90 enable WARNS=1 by default, but disable in unclean 3rd party code 1997-10-18 06:42:25 +00:00
lukem 47852f1f67 getopt returns -1 not EOF 1997-10-17 13:49:37 +00:00
lukem d2d85e1519 minor .Nm cleanup 1997-10-17 13:46:09 +00:00
leo a539aec784 Commit userland part of pr-1891. 1997-09-19 19:17:17 +00:00
enami 241ba6ead1 If f->f_type is F_FORW, don't close f->file. 1997-09-15 03:25:42 +00:00
enami 747812c50c Store constant `F_UNUSED' into the right place f->f_type
rather than f->f_file.
1997-09-13 07:53:10 +00:00
thorpej 1f01636e14 Cast time_t's to long, and use %ld format, when printing. 1997-07-18 22:48:31 +00:00
christos a838817b21 Add WARNS=1 1997-07-01 20:49:59 +00:00
christos 3c795cb2e0 - Fix warnings
- Use ttymsg from libutil.
1997-06-29 18:57:44 +00:00
pk 80bb266e0e NULL => 0 (Arne Juul; PR#3629) 1997-05-17 20:31:15 +00:00
gwr 10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
gwr 012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
mrg 151d9c8a60 add 0 and 0x prefixes for octal and hex numbers, in debug messages (based on pr#2964). 1997-04-26 05:12:32 +00:00
mrg dca7ab624c do not write pid file in debug mode. (pr#2825) 1997-04-26 05:08:29 +00:00
mouse 9dd8997bcf alternate -> alternative, per PR 2643 1997-03-08 14:34:56 +00:00