From a3cebea439328f3b79e912aaf55c9f9bb39dd4cb Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 13 Oct 2015 16:30:55 +0000 Subject: [PATCH] After the socket is open, the remainder is just io operations. Use pledge "stdio". --- usr.sbin/syslogc/syslogc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/syslogc/syslogc.c b/usr.sbin/syslogc/syslogc.c index da49cc69253..eaf4d62d860 100644 --- a/usr.sbin/syslogc/syslogc.c +++ b/usr.sbin/syslogc/syslogc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogc.c,v 1.17 2014/11/26 18:34:52 millert Exp $ */ +/* $OpenBSD: syslogc.c,v 1.18 2015/10/13 16:30:55 deraadt Exp $ */ /* * Copyright (c) 2004 Damien Miller @@ -147,6 +147,9 @@ main(int argc, char **argv) if ((ctlf = fdopen(ctlsock, "r+")) == NULL) err(1, "fdopen"); + if (pledge("stdio", NULL) == -1) + err(1, "stdio"); + cc.version = htonl(CTL_VERSION); cc.cmd = htonl(cc.cmd); /* Send command */ -- 2.20.1