Missed patch...

This commit is contained in:
bentley 2021-10-24 21:30:40 +00:00
parent 687dfe34a8
commit faef855ba5

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-main_c,v 1.1 2021/10/24 21:30:40 bentley Exp $
use pledge().
Index: main.c
--- main.c.orig
+++ main.c
@@ -173,6 +173,7 @@
#include <string.h>
#include <ctype.h>
#include <assert.h>
+#include <unistd.h>
#if defined(unix) && !defined(GO32)
#include <signal.h>
@@ -231,6 +232,11 @@ void usage(FILE *fp)
* Main program
*/
int main(int argc, char **argv) {
+ if (pledge("stdio rpath wpath cpath tty", NULL) == -1) {
+ fprintf(stderr, "pledge\n");
+ return 1;
+ }
+
fileoffset_t newoffset = -1, newwidth = -1;
/*