OpenBSD CVS

CVS log for src/usr.sbin/syslogd/privsep.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.77 / (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.76: +3 -3 lines
Diff to previous 1.76 (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.76 / (download) - annotate - [select for diffs], Fri Aug 11 04:45:06 2023 UTC (9 months, 4 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored)

Replace use of the old BSD st_*timespec members in struct stat with
the POSIX-standard st_*tim members.

ok millert@

Revision 1.75 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:15 2023 UTC (15 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.74: +1 -2 lines
Diff to previous 1.74 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.74 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:19 2021 UTC (2 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.73: +5 -5 lines
Diff to previous 1.73 (colored)

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant.  Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk.  They could all be 0xdeafbeef.
ok millert

Revision 1.73 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:21 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.72: +8 -8 lines
Diff to previous 1.72 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.72 / (download) - annotate - [select for diffs], Wed Sep 16 11:03:36 2020 UTC (3 years, 8 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.71: +2 -1 lines
Diff to previous 1.71 (colored)

close all fds > STDERR_FILENO before executing the pipe program.

OK bluhm@

Revision 1.71 / (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_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.70: +3 -7 lines
Diff to previous 1.70 (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.70 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:51 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.69: +8 -8 lines
Diff to previous 1.69 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Aug 7 18:36:49 2018 UTC (5 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.68: +27 -2 lines
Diff to previous 1.68 (colored)

Unveil fits nicely into the syslogd privsep model.  Unveiled files
include config file "r", utmp "r", /dev "rw", /bin/sh "x" for running
piped commands, and the syslogd binary "x" itself for HUP re-exec upon
config loads with changes.  Also unveiled in the privsep process are
the specific log files being written to.

If a config file reload changes no files, the existing privsep process
keeps running with unveil's to the relevant files (therefore it can
cope with newsyslogd taking files away).  If a new config file is loaded
which changes the output files, the privsep process is restarted with
fork+exec, and installs new unveils as needed.  The safety we gain from
unveil is that we've pigeonholed the privsep file-writer to exactly the
files required.

Help from bluhm for some edge cases.

Revision 1.68 / (download) - annotate - [select for diffs], Thu Apr 26 13:40:09 2018 UTC (6 years, 1 month ago) by bluhm
Branch: MAIN
Changes since 1.67: +9 -7 lines
Diff to previous 1.67 (colored)

Globally remember the passwd entry for _syslogd.  The user id is
used for opening the pipe process.  Move the getpwnam() lookup out
of the privsep parent loop, so it does not need "getpw" pledge
anymore.
OK deraadt@

Revision 1.67 / (download) - annotate - [select for diffs], Wed Apr 5 11:31:45 2017 UTC (7 years, 2 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.66: +13 -12 lines
Diff to previous 1.66 (colored)

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

Revision 1.66 / (download) - annotate - [select for diffs], Fri Dec 30 23:21:26 2016 UTC (7 years, 5 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.65: +10 -1 lines
Diff to previous 1.65 (colored)

When syslogd received a SIGHUP during startup, it died instead of
reloading its config.  This could happen when multiple signals were
sent during a short interval.  So block SIGHUP until signal handlers
are installed.
OK deraadt@ jca@

Revision 1.65 / (download) - annotate - [select for diffs], Tue Dec 27 19:16:24 2016 UTC (7 years, 5 months ago) by bluhm
Branch: MAIN
Changes since 1.64: +13 -5 lines
Diff to previous 1.64 (colored)

If syslogd was started with a relative path, the program could not
re-exec itself.  This exec is done during startup of the privsep
parent or when syslogd restarts after a SIGHUP.  Convert a relative
path in argv[0] to an absolute one with realpath(3) before chdir(2).
Do all the path handling in priv_init().
suggested by millert@; OK jca@

Revision 1.64 / (download) - annotate - [select for diffs], Sun Oct 16 22:12:50 2016 UTC (7 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Fix trailing whitespace and shorten long lines.
No binary change.

Revision 1.63 / (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.62: +4 -24 lines
Diff to previous 1.62 (colored)

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

Revision 1.62 / (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.61: +103 -86 lines
Diff to previous 1.61 (colored)

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

Revision 1.61 / (download) - annotate - [select for diffs], Tue Jun 28 18:22:50 2016 UTC (7 years, 11 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored)

whitespace nit

Revision 1.60 / (download) - annotate - [select for diffs], Sat Apr 2 19:55:10 2016 UTC (8 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

Eliminate superfluous 3rd params in fcntl(F_GETFL) calls.

ttymsg.c doesn't need to include fcntl.h.

Tweak standard fd sanitising to be more like the sanitise_stdfd()
used elsewhere, though other uses of 'nullfd' make importing
sanitise_stdfd() itself unappetizing.

Add a die(0) if dup2() fails.

suggestions & ok bluhm@

Revision 1.59 / (download) - annotate - [select for diffs], Tue Oct 20 12:40:19 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

After pledge "dns" has been refactored and setsockopt(SO_RCVBUF)
has been added to it, the syslogd privsep parent does not need
pledge "inet" anymore.
discussed with deraadt@

Revision 1.58 / (download) - annotate - [select for diffs], Sun Oct 18 16:35:06 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

Add "id" pledge to syslogd privsep process.  Needed for logging to pipe.
OK deraadt@

Revision 1.57 / (download) - annotate - [select for diffs], Fri Oct 16 16:10:10 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.56: +5 -1 lines
Diff to previous 1.56 (colored)

Pledge the syslogd privsep process with "stdio rpath wpath cpath
inet dns getpw sendfd proc exec".
OK deraadt@

Revision 1.56 / (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.55: +11 -10 lines
Diff to previous 1.55 (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.55 / (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.54: +3 -1 lines
Diff to previous 1.54 (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.54 / (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.53: +3 -1 lines
Diff to previous 1.53 (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.53 / (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.52: +1 -7 lines
Diff to previous 1.52 (colored)

Remove some unneeded includes.  OK deraadt@

Revision 1.52 / (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.51: +3 -1 lines
Diff to previous 1.51 (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.51 / (download) - annotate - [select for diffs], Mon Jan 19 16:40:49 2015 UTC (9 years, 4 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.50: +7 -5 lines
Diff to previous 1.50 (colored)

Replace HOST_NAME_MAX+1 with NI_MAXHOST when the hostname is used
with getaddrinfo() or getnameinfo(), but keep HOST_NAME_MAX+1 when
the hostname comes from gethostname().
No binary change;  OK deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:21 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.49: +10 -9 lines
Diff to previous 1.49 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.49 / (download) - annotate - [select for diffs], Wed Dec 31 13:55:57 2014 UTC (9 years, 5 months ago) by bluhm
Branch: MAIN
Changes since 1.48: +25 -8 lines
Diff to previous 1.48 (colored)

Implement sending syslog messages over TCP streams.
test and OK jasper@ jca@

Revision 1.48 / (download) - annotate - [select for diffs], Sun Oct 5 18:14:01 2014 UTC (9 years, 8 months ago) by bluhm
Branch: MAIN
Changes since 1.47: +17 -17 lines
Diff to previous 1.47 (colored)

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

Revision 1.47 / (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.46: +3 -3 lines
Diff to previous 1.46 (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.46 / (download) - annotate - [select for diffs], Sat Sep 27 11:28:37 2014 UTC (9 years, 8 months ago) by bluhm
Branch: MAIN
Changes since 1.45: +1 -2 lines
Diff to previous 1.45 (colored)

Also in debug mode, close nullfd when it is not needed anymore.
OK doug@

Revision 1.45 / (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.44: +5 -5 lines
Diff to previous 1.44 (colored)

Remove redundant null check and rename vars consistently in syslogd

Merge in more functionality from bluhm's patch.

ok bluhm@

Revision 1.44 / (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.43: +4 -2 lines
Diff to previous 1.43 (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.43 / (download) - annotate - [select for diffs], Mon Aug 25 20:19:14 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.42: +9 -9 lines
Diff to previous 1.42 (colored)

Call check_tty_name() and check_log_name() with the string size and
don't access memory beyond.  Make sure that the complete string
"/dev/null" can be copied.
OK henning@

Revision 1.42 / (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.41: +31 -10 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Mon Aug 25 18:05:30 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.40: +12 -9 lines
Diff to previous 1.40 (colored)

Fix the gcc compiler warnings "comparison between signed and
unsigned".  Some checks got stricter.  The (size_t) cast is only
done, if the argument is not negative.
OK henning@

Revision 1.40 / (download) - annotate - [select for diffs], Thu Aug 21 17:00:34 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.39: +5 -3 lines
Diff to previous 1.39 (colored)

Send and receive UDP syslog packets on the IPv6 socket.
OK henning@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Aug 21 00:04:58 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

Parse loghost in a separate function.  Allow [] around hostname,
needed for IPv6 addresses.  Print full loghost specifier in case
of error or debug.  Make string sizes more precise.
input henning@; input and OK deraadt@

Revision 1.38 / (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.37: +33 -33 lines
Diff to previous 1.37 (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.37 / (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.36: +12 -10 lines
Diff to previous 1.36 (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.36 / (download) - annotate - [select for diffs], Tue Aug 19 00:53:01 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.35: +9 -9 lines
Diff to previous 1.35 (colored)

The _exit codes in syslogd privsep.c were the wrong way around.
Fatal errors should exit with 1, and regular shutdown should result
in exit with 0.
OK deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Tue Aug 19 00:28:48 2014 UTC (9 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.34: +13 -15 lines
Diff to previous 1.34 (colored)

Replace manually written function names with __func__.
OK sthen@

Revision 1.34 / (download) - annotate - [select for diffs], Sun Nov 23 04:29:42 2008 UTC (15 years, 6 months ago) by brad
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, 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, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Remove some whitespace.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Sep 29 18:41:56 2008 UTC (15 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

do not close a random file descriptor in debug mode, PR 5938 from mickey

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 16 16:55:29 2008 UTC (16 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.31: +5 -3 lines
Diff to previous 1.31 (colored)

avoid errno trashing, ok mpf henning

Revision 1.31 / (download) - annotate - [select for diffs], Sun Mar 16 15:44:18 2008 UTC (16 years, 2 months ago) by mpf
Branch: MAIN
Changes since 1.30: +4 -6 lines
Diff to previous 1.30 (colored)

syslogd leaves zombies around if multiple  |/pathto/mylogprog
children died in a row.
Do waitpid(2) in a loop until there's nothing left.
OK henning@, millert@

Revision 1.30 / (download) - annotate - [select for diffs], Thu Mar 15 05:18:32 2007 UTC (17 years, 2 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.29: +7 -5 lines
Diff to previous 1.29 (colored)

use warnx and not logerror in monitor, logerror is for the slave;
ok henning@ while in lock

Revision 1.29 / (download) - annotate - [select for diffs], Tue Feb 20 11:24:32 2007 UTC (17 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.28: +105 -5 lines
Diff to previous 1.28 (colored)

implement logging to other program's stdin.
if the target is like "| /path/to/program", syslogd forks and execs program
and sends the selected log messages to program's stdin.
uses a socketpair, grows the receive buffer on the reader side and has the
socket nonblocking on syslog'd side to prevent syslogd blocking.
I'm using that here to feed logsurfer from ports for automated log analysis,
werks beautifully.
lots of input & help mpf, ok mpf djm "no objections" millert

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jul 9 14:42:27 2006 UTC (17 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.27: +15 -7 lines
Diff to previous 1.27 (colored)

Use sigaction() instead of signal() in the parent and use the
SA_NOCLDSTOP flag for the SIGCHLD handler so the kernel does not
notify us when the child has been stopped, only when it exits.
Fixes a problem where if you suspended the child process the
parent would exit.  OK otto@

Revision 1.27 / (download) - annotate - [select for diffs], Fri Dec 2 16:50:11 2005 UTC (18 years, 6 months ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.26: +2 -1 lines
Diff to previous 1.26 (colored)

unlink() pid file on exit. ok deraadt@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jun 6 23:20:44 2005 UTC (19 years ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.25: +3 -1 lines
Diff to previous 1.25 (colored)

fix fd leak on SIGHUP after config change, spotted by Stephen Marley; ok avsm@

Revision 1.25 / (download) - annotate - [select for diffs], Mon May 23 20:12:28 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

noo need for endpwent() here at all, ok theo

Revision 1.24 / (download) - annotate - [select for diffs], Tue May 3 05:44:35 2005 UTC (19 years, 1 month ago) by djm
Branch: MAIN
Changes since 1.23: +6 -13 lines
Diff to previous 1.23 (colored)

setres[ug]id; ok deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Sep 14 23:41:29 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.22: +17 -15 lines
Diff to previous 1.22 (colored)

portable code should not use that gcc __func__ specific junk when it is not needed

Revision 1.22 / (download) - annotate - [select for diffs], Tue Sep 14 23:26:41 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

ARGSUSED before signal handler with unused signo

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jul 9 16:22:04 2004 UTC (19 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

ansi

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jul 3 23:40:44 2004 UTC (19 years, 11 months ago) by djm
Branch: MAIN
Changes since 1.19: +9 -9 lines
Diff to previous 1.19 (colored)

-Wall,-Wshadow cleanup with avsm@; ok henning@ krw@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jul 3 05:32:18 2004 UTC (19 years, 11 months ago) by djm
Branch: MAIN
Changes since 1.18: +38 -15 lines
Diff to previous 1.18 (colored)

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

Revision 1.18 / (download) - annotate - [select for diffs], Fri Apr 9 20:13:25 2004 UTC (20 years, 2 months ago) by canacar
Branch: MAIN
Changes since 1.17: +5 -3 lines
Diff to previous 1.17 (colored)

Also pass SIGINT and SIGQUIT to child, noticed by mpech@
ok avsm@

Revision 1.17 / (download) - annotate - [select for diffs], Fri Apr 2 21:44:50 2004 UTC (20 years, 2 months ago) by avsm
Branch: MAIN
Changes since 1.16: +13 -9 lines
Diff to previous 1.16 (colored)

Do not bother closing an fd when we know it has failed.
Based on diff from Moritz Jodeit <moritz at jodeit.org>

Revision 1.16 / (download) - annotate - [select for diffs], Sun Mar 14 19:17:05 2004 UTC (20 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

Check return code of chdir() after chroot(); noted by Joris Vink, slight mod
from avsm@.
ok avsm@ hshoexer@ henning@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 6 19:42:38 2004 UTC (20 years, 3 months ago) by otto
Branch: MAIN
Changes since 1.14: +9 -5 lines
Diff to previous 1.14 (colored)

cleanup, mostly signal handling
ok henning@ millert@ avsm@

Revision 1.14 / (download) - annotate - [select for diffs], Thu Feb 26 11:04:15 2004 UTC (20 years, 3 months ago) by avsm
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

cure my speling

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jan 4 08:28:49 2004 UTC (20 years, 5 months ago) by djm
Branch: MAIN
Changes since 1.12: +8 -2 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Mon Dec 29 22:09:36 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

delint

Revision 1.11 / (download) - annotate - [select for diffs], Mon Dec 29 22:08:44 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

spacing

Revision 1.10 / (download) - annotate - [select for diffs], Mon Dec 29 22:05:10 2003 UTC (20 years, 5 months ago) by djm
Branch: MAIN
Changes since 1.9: +9 -8 lines
Diff to previous 1.9 (colored)

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

Revision 1.9 / (download) - annotate - [select for diffs], Sun Oct 26 18:21:49 2003 UTC (20 years, 7 months ago) by avsm
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

correct bad dprintf, from Moritz Jodeit <moritz at jodeit.org>

Revision 1.8 / (download) - annotate - [select for diffs], Fri Oct 24 21:21:27 2003 UTC (20 years, 7 months ago) by canacar
Branch: MAIN
Changes since 1.7: +34 -10 lines
Diff to previous 1.7 (colored)

fix an occasional hang noticed by mpech@ when a SIGHUP
is received after the configuration is modified.

tested by mpech@, ok avsm@

Revision 1.7 / (download) - annotate - [select for diffs], Wed Oct 22 19:37:38 2003 UTC (20 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +7 -1 lines
Diff to previous 1.6 (colored)

setgroups; avsm ok

Revision 1.6 / (download) - annotate - [select for diffs], Wed Sep 24 23:35:45 2003 UTC (20 years, 8 months ago) by avsm
Branch: MAIN
Changes since 1.5: +40 -14 lines
Diff to previous 1.5 (colored)

cleanup privsep communications between child/parent with a lot more
paranoia.  noticed by aaron@, feedback from drahn@ cloder@ millert@

Revision 1.5 / (download) - annotate - [select for diffs], Fri Aug 15 23:13:06 2003 UTC (20 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

remove extra \n in {warn,err}{,x} calls

Revision 1.4 / (download) - annotate - [select for diffs], Fri Aug 1 14:04:35 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
Changes since 1.3: +9 -19 lines
Diff to previous 1.3 (colored)

clean up debug output some, and correct an incorrect error check in
priv_gethostbyaddr()

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jul 31 21:28:28 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

delint

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jul 31 18:25:58 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
Changes since 1.1: +6 -6 lines
Diff to previous 1.1 (colored)

knf

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

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.