small change on st.c and x.c

Commit 130d532e0be8 · konakona · 2026-11-20 22:26 +0700

Changeset
130d532e0be8050eea230ea4f454f5b774618e28

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@
 	sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
 	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
 	tic -sx st.info
-	@echo Please see the README file regarding the terminfo entry of st.
+	@echo Please see the README file regarding the terminfo entry of sst.
 
 uninstall:
 	rm -f $(DESTDIR)$(PREFIX)/bin/st
diff --git a/st.c b/st.c
--- a/st.c
+++ b/st.c
@@ -801,14 +801,14 @@
 		if (s > 2)
 			close(s);
 #ifdef __OpenBSD__
-		if (pledge("stdio rpath tty getpw proc exec", NULL) == -1)
+		if (pledge("stdio rpath wpath cpath tty getpw proc exec", NULL) == -1)
 			die("pledge\n");
 #endif
 		execsh(cmd, args);
 		break;
 	default:
 #ifdef __OpenBSD__
-		if (pledge("stdio rpath tty proc", NULL) == -1)
+		if (pledge("stdio rpath wpath cpath tty getpw proc", NULL) == -1)
 			die("pledge\n");
 #endif
 		close(s);
diff --git a/x.c b/x.c
--- a/x.c
+++ b/x.c
@@ -2103,20 +2103,24 @@
 	}
 
 	if (unveil("/etc", "r") == -1 ||
+			unveil("/var", "r") == -1 ||
+			unveil("/bin", "r") == -1 ||
+			unveil("/sbin", "r") == -1 ||
+			unveil("/usr/bin", "r") == -1 ||
+			unveil("/usr/sbin", "r") == -1 ||
+			unveil("/usr/local/bin", "r") == -1 ||
 			unveil("/usr/lib", "r") == -1 ||
+			unveil("/usr/libexec", "r") == -1 ||
 			unveil("/usr/local/lib", "r") == -1 ||
 			unveil("/etc/fonts", "r") == -1 ||
 			unveil("/usr/share/fonts", "r") == -1 ||
 			unveil("/usr/X11R6/lib/X11/fonts", "r") == -1 ||
 			unveil("/usr/X11R6/lib/X11/xkb", "r") == -1 ||
 			unveil("/usr/share/locale", "r") == -1 ||
-			unveil("/dev/tty", "rw") == -1 ||
-			unveil("/dev/ptm", "rw") == -1 ||
+			unveil("/dev", "rw") == -1 ||
 			unveil("/tmp/.X11-unix", "rw") == -1 ||
 			unveil(xauthority, "r") == -1 ||
 			(home && unveil(home, "r") == -1) ||
-			unveil("/bin", "r") == -1 ||
-			unveil("/usr/bin", "r") == -1 ||
 			unveil(NULL, NULL) == -1) {
 		die("unveil: %s\n", strerror(errno));
 	}