Use pledge(2).

Initial patch from Ali H. Fardan.

ok sthen@ jung@
This commit is contained in:
jca 2016-08-14 15:35:14 +00:00
parent a13da41c70
commit b324102395
2 changed files with 15 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.5 2013/10/19 09:49:51 jung Exp $
# $OpenBSD: Makefile,v 1.6 2016/08/14 15:35:14 jca Exp $
COMMENT= simple irc client
DISTNAME= sic-1.2
REVISION= 0
CATEGORIES= net
@ -13,6 +14,7 @@ MAINTAINER = Joerg Jung <jung@openbsd.org>
# MIT/X
PERMIT_PACKAGE_CDROM= Yes
# uses pledge()
WANTLIB= c
MASTER_SITES= http://dl.suckless.org/tools/

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-sic_c,v 1.3 2016/08/14 15:35:14 jca Exp $
--- sic.c.orig Fri Aug 12 21:45:07 2016
+++ sic.c Fri Aug 12 21:54:39 2016
@@ -173,6 +173,8 @@ main(int argc, char *argv[]) {
fflush(srv);
setbuf(stdout, NULL);
setbuf(srv, NULL);
+ if (pledge("stdio", NULL) == -1)
+ eprint("error: pledge:");
for(;;) { /* main loop */
FD_ZERO(&rd);
FD_SET(0, &rd);