Parcourir la source

add pledge(2) security mitigation

Jan Klemkow il y a 6 ans
Parent
commit
db5282af9c
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      scroll.c

+ 5 - 0
scroll.c

@@ -225,6 +225,11 @@ main(int argc, char *argv[])
 		_exit(127);
 	}
 
+#ifdef __OpenBSD__
+	if (pledge("stdio tty proc", NULL) == -1)
+		die("pledge:");
+#endif
+
 	if (signal(SIGCHLD, sigchld) == SIG_ERR)
 		die("signal:");
 	if (signal(SIGWINCH, sigwinch) == SIG_ERR)