OpenBSD CVS

CVS log for src/usr.sbin/syslogd/syslogd.h


[BACK] Up to [local] / src / usr.sbin / syslogd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.37 / (download) - annotate - [select for diffs], Thu Oct 12 22:36:54 2023 UTC (7 months, 3 weeks ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored)

Retry DNS lookup for remote loghost.

If DNS lookup for a remote loghost configured in syslog.conf did
not work at startup, the entry was ignored.  Better retry the lookup
in intervals until it succeeds.  Improve debug output to print IP
address after resolution.  Unify retry code that resolves DNS for
UDP and connects to TCP server.

testing and feedback from Paul de Weerd; OK deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jan 13 10:34:07 2022 UTC (2 years, 4 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.35: +3 -1 lines
Diff to previous 1.35 (colored)

Move parsing of incoming syslog messages to their own section.
This should make it more manageable.

No functional change intended, debugging output slightly changed.

help from and OK bluhm@

Revision 1.35 / (download) - annotate - [select for diffs], Fri Sep 10 15:18:36 2021 UTC (2 years, 8 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

When writing a message, syslogd did a combination of putting
everything into an iov and do some sprintf() formating later.  Better
put everything into the iov upfront based on what the output methods
need.  Then either the full iov is written or a line is created by
concatenating.
OK martijn@

Revision 1.34 / (download) - annotate - [select for diffs], Fri Sep 3 16:28:33 2021 UTC (2 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.33: +4 -2 lines
Diff to previous 1.33 (colored)

Use a define for the iov array size in syslogd.  This is better
than passing the magic number 6 around and checking at runtime
whether its fits.
OK deraadt@ martijn@ mvs@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jul 5 13:23:27 2019 UTC (4 years, 11 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.32: +1 -6 lines
Diff to previous 1.32 (colored)

When syslogd(8) parent process terminates, the file cleanup code
did not work anymore.  unveil(2) prevented removal.  Cleaning the
UNIX domain sockets is not necessary.  They are harmless and unlinked
before a new bind.  So delete that functionality and convert global
to local variables.  Providing /var/run/syslog.pid is a common
feature that should be kept.  A stale pid file is confusing.  So
add a constant path to unveil(2) to allow pid file removal.
OK deraadt@

Revision 1.32 / (download) - annotate - [select for diffs], Thu Oct 5 16:15:24 2017 UTC (6 years, 8 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

I have touched more than half the source code lines of syslogd(8).
Add my copyright explicitly.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Aug 8 14:23:23 2017 UTC (6 years, 10 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored)

Kernel sendsyslog(2), libc syslog(3), and syslogd(8) restrict and
truncate the length of a syslog message to 8192 bytes.  Use one
global define LOG_MAXLINE for all of them.
OK deraadt@ millert@

Revision 1.30 / (download) - annotate - [select for diffs], Wed Apr 5 22:15:35 2017 UTC (7 years, 2 months ago) by bluhm
Branch: MAIN
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored)

The global variable Startup is not used anymore and can be deleted.
The functionality has moved into log_setdebug().
OK millert@

Revision 1.29 / (download) - annotate - [select for diffs], Wed Apr 5 21:55:31 2017 UTC (7 years, 2 months ago) by bluhm
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

As we did not have nice log functions before, ttymsg() had to return
the error string.  Log the message when the error happens and make
the function void.
OK millert@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Apr 5 11:31:45 2017 UTC (7 years, 2 months ago) by bluhm
Branch: MAIN
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

Replace logdebug() with generic log_debug() from log.c.  Implement
log_debugadd() to construct debug message incrementally.
OK deraadt@

Revision 1.27 / (download) - annotate - [select for diffs], Thu Mar 16 23:55:19 2017 UTC (7 years, 2 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.26: +5 -1 lines
Diff to previous 1.26 (colored)

Start to replace the home grown syslogd(8) internal debug and logging
functions with a more common log.c implementation.  Of course
openlog(3) cannot be used, so adapt the log.[ch] initially copied
from ospfd(8) to syslogd's special needs.  As the messages are
limited to ERRBUFSIZE anyway, malloc(3) in the error logging code
can be avoided.  Changing all log calls to the new API will be done
in a separate step.
OK millert@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Oct 17 11:19:55 2016 UTC (7 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.25: +2 -3 lines
Diff to previous 1.25 (colored)

Remove the artificial maximum number of unix domain sockets in
syslogd(8).  Just malloc(3) them dynamically which also gives a
more random address space layout.
OK deraadt@

Revision 1.25 / (download) - annotate - [select for diffs], Sun Oct 16 22:00:14 2016 UTC (7 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.24: +1 -3 lines
Diff to previous 1.24 (colored)

Use closefrom(4) in privsep parent and avoid some global file
descriptor variables in syslogd(8) this way.
OK rzalamena@

Revision 1.24 / (download) - annotate - [select for diffs], Thu Oct 6 13:03:47 2016 UTC (7 years, 8 months ago) by bluhm
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

Do an exec on itself in the privileged syslogd(8) parent process
to reshuffle its memory layout.
Input rzalamena@; OK deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Fri Oct 23 16:28:52 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.22: +3 -1 lines
Diff to previous 1.22 (colored)

If writing to a tty blocks, syslogd forked and tried to write again
in a background process.  A potential fork(2) at every message is
bad, so replace this with an event.  As a bonus the syslogd child
process does not need to pledge "proc" anymore.  Also limit the
number of delayed write events.
OK deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Oct 21 14:03:07 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.21: +4 -2 lines
Diff to previous 1.21 (colored)

Do some cleanup in syslogd ttymsg().  Add a debug message when the
syslogd child calls fork(2) to delay blocked output.
OK benno@

Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 15 20:26:47 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

In syslogd replace the dprintf() macro with a logdebug() function
as dprintf(3) is in libc now and does something different.
OK guenther@

Revision 1.20 / (download) - annotate - [select for diffs], Fri Oct 9 16:58:25 2015 UTC (8 years, 8 months ago) by bluhm
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

If syslogd is started with -S, it accepts TLS connections to receive
encrypted messages.  The server certificates are taken from /etc/ssl
like relayd does.
OK benno@ beck@ deraadt@

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jul 7 17:53:04 2015 UTC (8 years, 11 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

When syslogd is invoked with -T listen_address, it creates a TCP
socket and accepts incomming messages.  At the moment, only RFC
6587 3.4.2. Non-Transparent-Framing format with new-line separator
is supprted for incomming messsages.  Outgoing messages are encoded
as 3.4.1. Octet Counting.  Autodetection of incomming format will
be implemented later.
OK deraadt@ jmc@ millert@

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jul 6 16:12:16 2015 UTC (8 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Remove some unneeded includes.  OK deraadt@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jun 30 12:03:32 2015 UTC (8 years, 11 months ago) by bluhm
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Add a -U command line switch for syslogd to specify an explict bind
address to receive UDP packets.  One advantge over -u and the *
sockets is that you can bind to localhost and divert the packets
with pf.  It is also possible to use a non standard port.
OK jung@ jmc@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Oct 5 18:14:01 2014 UTC (9 years, 8 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.15: +3 -12 lines
Diff to previous 1.15 (colored)

Switch syslogd from using poll(2) to libevent.
test and OK nicm@; OK henning@

Revision 1.15 / (download) - annotate - [select for diffs], Fri Oct 3 21:55:22 2014 UTC (9 years, 8 months ago) by bluhm
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Cleanup the reporting socket code in syslogd.
- Name variable path_ctlsock consistently.
- Name function ctlconn_logto() consistently.
- Replace the nested if/else logic in ctlconn_write_handler()
  with if/return.
- Call ctlconn_cleanup() only if there is a control connection.
OK doug@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Sep 10 13:16:20 2014 UTC (9 years, 9 months ago) by doug
Branch: MAIN
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

Remove redundant null check and rename vars consistently in syslogd

Merge in more functionality from bluhm's patch.

ok bluhm@

Revision 1.13 / (download) - annotate - [select for diffs], Mon Sep 8 00:43:42 2014 UTC (9 years, 9 months ago) by doug
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

Fix a syslogd regression when specifying all 20 additional log paths

bluhm@ found and fixed this bug.  This is a modified version of his
patch which makes the intention a little clearer.

ok bluhm@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Aug 25 18:19:18 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Allow to restrict syslogd to a protocol family with -4 and -6 command
line switches.  If the log server is an FQDN, DNS chooses wether
to take the IPv4 or IPv6 route.  Allow to prefix the log host with
udp4:// or udp6:// to choose a protocol.
OK henning@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Aug 20 20:10:17 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Replace gethostbyaddr(3) with getnameinfo(3).  Remove the sigprocmask()
that was necessary for gethostbyaddr() because the latter is not
signal safe.  Change the return code semantics of priv_getnameinfo()
to match getnameinfo(3).
input and OK jca@

Revision 1.10 / (download) - annotate - [select for diffs], Wed Aug 20 19:33:43 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.9: +2 -0 lines
Diff to previous 1.9 (colored)

Add missing OpenBSD RCS id.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Aug 20 19:16:27 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.8: +1 -1 lines
Diff to previous 1.8 (colored)

Rename priv_gethostserv() to priv_getaddrinfo() as this is what the
function does.  Change the return code semantics to match getaddrinfo(3).
OK deraadt@

Revision 1.8 / (download) - annotate - [select for diffs], Mon Aug 19 06:09:23 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.7: +1 -1 lines
Diff to previous 1.7 (colored)

put do { } while (0) around the dprintf macro to make it less scary

ok deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Fri Apr 30 19:29:01 2010 UTC (14 years, 1 month ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.6: +1 -0 lines
Diff to previous 1.6 (colored)

shuffle some things around to deal with incomplete types
gcc4 gets upset about.
based on suggestions from miod@, ok millert@

Revision 1.6 / (download) - annotate - [select for diffs], Wed May 2 15:17:11 2007 UTC (17 years, 1 month ago) by jason
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

- use getaddrinfo() instead of gethostbyname/getservbyname
- reserve a poll descriptor entry for INET6 (not used yet)
ok henning

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 6 23:22:04 2005 UTC (19 years ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.4: +1 -0 lines
Diff to previous 1.4 (colored)

memory leak on SIGHUP for memory buffer logs, based on fix by Stephen Marley;
ok avsm@

Revision 1.4 / (download) - annotate - [select for diffs], Sat Jul 3 05:32:19 2004 UTC (19 years, 11 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.3: +4 -1 lines
Diff to previous 1.3 (colored)

support @hostname:port syntax in syslog.conf, prompted by msf@ at c2k4;
ok henning@ anil@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 4 08:28:49 2004 UTC (20 years, 5 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.2: +16 -1 lines
Diff to previous 1.2 (colored)

Buffered logging for syslogd. Logs may be stored in memory buffers and
extracted using a small client. Useful for diskless systems.
much feedback from deraadt@, canacar@, jmc@, jakob@ ; ok deraadt@

Revision 1.2 / (download) - annotate - [select for diffs], Mon Dec 29 22:05:11 2003 UTC (20 years, 5 months ago) by djm
Branch: MAIN
Changes since 1.1: +7 -4 lines
Diff to previous 1.1 (colored)

convert from select() to poll() for main event loop; tested millert@, deraadt@
ok deraadt@

Revision 1.1 / (download) - annotate - [select for diffs], Thu Jul 31 18:20:07 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4

Privilege separated syslog daemon.  The child listening to log requests drops
to user _syslogd and chroots itself, while the privileged parent grants it
access to open logfiles and other calls it needs.

The only difference from existing behaviour is that if syslog.conf changes
and syslogd receives a HUP, it will re-exec itself and have two new PIDs.
A HUP with an unchanged config will make syslogd reopen logfiles as before.

Lots of help and code from deraadt@ , and advice from millert@

Various versions tested by todd, cloder, mpech, markus, tdeval and others

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.