summaryrefslogtreecommitdiff
path: root/sbin/pflogd
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2004-01-18 14:21:53 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2004-01-18 14:21:53 +0000
commitc1e90e3b6d2998e61579e95c37cead1502b45daa (patch)
treea2f721e89b4f1dac2f070e141cc83eafa19061a0 /sbin/pflogd
parent66ac0aa5fe117bcd0467534da9724d3fd62f2d4d (diff)
Create log files if they do not already exist, but do not follow
symlinks. ok markus@
Diffstat (limited to 'sbin/pflogd')
-rw-r--r--sbin/pflogd/privsep.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/pflogd/privsep.c b/sbin/pflogd/privsep.c
index 0eb244ba35a..158255d3272 100644
--- a/sbin/pflogd/privsep.c
+++ b/sbin/pflogd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.5 2004/01/15 20:10:43 canacar Exp $ */
+/* $OpenBSD: privsep.c,v 1.6 2004/01/18 14:21:52 canacar Exp $ */
/*
* Copyright (c) 2003 Can Erkin Acar
@@ -141,9 +141,10 @@ priv_init(void)
case PRIV_OPEN_LOG:
logmsg(LOG_DEBUG,
"[priv]: msg PRIV_OPEN_LOG received");
-
- /* XXX */
- fd = open(filename, O_RDWR|O_APPEND|O_NONBLOCK, 0);
+ /* create or append logs but do not follow symlinks */
+ fd = open(filename,
+ O_RDWR|O_CREAT|O_APPEND|O_NONBLOCK|O_NOFOLLOW,
+ 0600);
if (fd < 0)
logmsg(LOG_NOTICE,
"[priv]: failed to open %s: %s",