summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--x11/xterm/Makefile2
-rw-r--r--x11/xterm/patches/patch-main_c77
2 files changed, 74 insertions, 5 deletions
diff --git a/x11/xterm/Makefile b/x11/xterm/Makefile
index e2292de..08eec5e 100644
--- a/x11/xterm/Makefile
+++ b/x11/xterm/Makefile
@@ -2,7 +2,7 @@
COMMENT = terminal emulator for the X Window System.
DISTNAME = xterm-367
-REVISION = 1
+REVISION = 2
CATEGORIES = x11
diff --git a/x11/xterm/patches/patch-main_c b/x11/xterm/patches/patch-main_c
index 0b2573b..1d31a02 100644
--- a/x11/xterm/patches/patch-main_c
+++ b/x11/xterm/patches/patch-main_c
@@ -1,11 +1,11 @@
$OpenBSD$
-Add pledge()
+Add pledge() and unveil()
Index: main.c
--- main.c.orig
+++ main.c
-@@ -2893,6 +2893,25 @@ main(int argc, char *argv[]ENVP_ARG)
+@@ -2893,6 +2893,94 @@ main(int argc, char *argv[]ENVP_ARG)
if (resource.maximized)
RequestMaximize(term, True);
#endif
@@ -21,11 +21,80 @@ Index: main.c
+ exit(1);
+ }
+ } else {
++ char *env;
++ if ((env = getenv("HOME"))) {
++ char homefile[PATH_MAX];
++
++ snprintf(homefile, sizeof homefile, "%s/.fonts", env);
++ if (unveil(homefile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ snprintf(homefile, sizeof homefile, "%s/.cache/fontconfig",
++ env);
++ if (unveil(homefile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ snprintf(homefile, sizeof homefile, "%s/.icons", env);
++ if (unveil(homefile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ }
++ if ((env = getenv("XDG_CONFIG_HOME"))) {
++ char xdgfile[PATH_MAX];
++
++ snprintf(xdgfile, sizeof xdgfile, "%s/fontconfig", env);
++ if (unveil(xdgfile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ snprintf(xdgfile, sizeof xdgfile, "%s/icons", env);
++ if (unveil(xdgfile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ }
++ if ((env = getenv("XDG_DATA_HOME"))) {
++ char xdgfile[PATH_MAX];
++
++ snprintf(xdgfile, sizeof xdgfile, "%s/fontconfig", env);
++ if (unveil(xdgfile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ snprintf(xdgfile, sizeof xdgfile, "%s/icons", env);
++ if (unveil(xdgfile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ }
++ if ((env = getenv("XDG_CACHE_HOME"))) {
++ char xdgfile[PATH_MAX];
++
++ snprintf(xdgfile, sizeof xdgfile, "%s/fontconfig", env);
++ if (unveil(xdgfile, "r") == -1) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++ }
++ if ((unveil("/usr/X11R6", "r") == -1) ||
++ (unveil("/usr/local/share/fonts", "r") == -1) ||
++ (unveil("/var/cache/fontconfig", "r") == -1) ||
++ (unveil("/usr/local/share/icons", "r") == -1) ||
++ (unveil("/usr/local/lib/X11/icons", "r") == -1) ||
++ (unveil(etc_utmp, "w") == -1) ||
++ (unveil(etc_wtmp, "w") == -1)) {
++ xtermWarning("unveil\n");
++ exit(1);
++ }
++
+ if (pledge("stdio rpath wpath id proc tty", NULL) == -1) {
+ xtermWarning("pledge\n");
+ exit(1);
-+ }
-+ }
++ }
++ }
+ }
+
for (;;) {