possible to pledge "stdio rpath wpath tty proc"
Noone uses this code anymore. This is a demonstration...
-/* $OpenBSD: comsat.c,v 1.41 2015/10/09 17:07:21 deraadt Exp $ */
+/* $OpenBSD: comsat.c,v 1.42 2015/10/09 17:09:06 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
#include <unistd.h>
#include <utmp.h>
#include <vis.h>
+#include <err.h>
int debug = 0;
#define dsyslog if (debug) syslog
char msgbuf[100];
sigset_t sigset;
+ if (pledge("stdio rpath wpath tty proc", NULL) == -1)
+ err(1, "pledge");
+
/* verify proper invocation */
fromlen = sizeof(from);
if (getsockname(0, (struct sockaddr *)&from, &fromlen) == -1) {