multiple change

Commit d769e6ed3e7a · konakona · 2026-11-17 18:33 +0700

Changeset
d769e6ed3e7a9a47d16e43d98be95bbfb4a5825a

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# st - simple terminal
+# sst - simple secure terminal
 # See LICENSE file for copyright and license details.
 .POSIX:
 
diff --git a/README b/README
--- a/README
+++ b/README
@@ -1,34 +1,34 @@
 # sst - simple secure terminal
---------------------
+
 sst is a simple and secure terminal emulator for X that fork from [st](https://suckless.org/st) which sucks less.
 
 
 # Requirements
-------------
-In order to build st you need the Xlib header files.
+
+In order to build sst you need the Xlib header files.
 
 
 # Installation
-------------
-Edit config.mk to match your local setup (st is installed into
+
+Edit config.mk to match your local setup (sst is installed into
 the /usr/local namespace by default).
 
-Afterwards enter the following command to build and install st (if
+Afterwards enter the following command to build and install sst (if
 necessary as root):
 
     make clean install
 
 
-# Running st
-----------
+# Running sst
+
 If you did not install st with make clean install, you must compile
 the st terminfo entry with the following command:
 
-    tic -sx st.info
+    tic -sx sst.info
 
 See the man page for additional details.
 
 # Credits
 -------
-Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.
+Based on st made by Hiltjo Posthuma <[email protected]> .
 
diff --git a/config.mk b/config.mk
--- a/config.mk
+++ b/config.mk
@@ -1,4 +1,4 @@
-# st version
+# sst version
 VERSION = 0.9.3
 
 # Customize below to fit your system
@@ -16,7 +16,7 @@
 INCS = -I$(X11INC) \
        `$(PKG_CONFIG) --cflags fontconfig` \
        `$(PKG_CONFIG) --cflags freetype2`
-LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
+LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
        `$(PKG_CONFIG) --libs fontconfig` \
        `$(PKG_CONFIG) --libs freetype2`
 
diff --git a/x.c b/x.c
--- a/x.c
+++ b/x.c
@@ -2091,13 +2091,31 @@
 	} ARGEND;
 
 #ifdef __OpenBSD__
+	char xauthority[PATH_MAX];
+	char *home = getenv("HOME");
+	char *xauth_env = getenv("XAUTHORITY");
+	int unveil(const char *, const char *);
+
+	if (xauth_env) {
+		snprintf(xauthority, sizeof(xauthority), "%s", xauth_env);
+	} else {
+		snprintf(xauthority, sizeof(xauthority), "%s/.Xauthority", home ? home : "");
+	}
 
 	if (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("/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));
+		die("unveil: %s\n", strerror(errno));
 	}
 #endif