[hackers] [lchat] lchat: add pledge(2) support || Tom Schwindl

From: <git_AT_suckless.org>
Date: Sun, 14 Jul 2024 13:40:31 +0200 (CEST)

commit 0c43215d0b1981d1689105122da02b7e994e250a
Author: Tom Schwindl <schwindl_AT_posteo.de>
AuthorDate: Sat Sep 23 22:17:26 2023 +0200
Commit: Jan Klemkow <j.klemkow_AT_wemelug.de>
CommitDate: Sun Jul 14 13:40:21 2024 +0200

    lchat: add pledge(2) support

diff --git a/lchat.c b/lchat.c
index 6c57ec4..05274af 100644
--- a/lchat.c
+++ b/lchat.c
_AT_@ -152,6 +152,10 @@ usage(void)
 int
 main(int argc, char *argv[])
 {
+#ifdef __OpenBSD__
+ if (pledge("stdio rpath wpath tty proc exec", NULL) == -1)
+ die("pledge:");
+#endif
         struct pollfd pfd[3];
         struct termios term;
         struct slackline *sl = sl_init();
Received on Sun Jul 14 2024 - 13:40:31 CEST

This archive was generated by hypermail 2.3.0 : Sun Jul 14 2024 - 13:48:36 CEST