Hi!

Like I said yesterday, I don't know how to reproduce this bug, it just
happened to me and I got this dmesg(1):
xterm[90461]: pledge "cpath", syscall 5

Right now I quickly grep(1)'ed xterm(1)'s source code:
mazocomp$ egrep "mkdir\(|unlink\(|rmdir\(" -R . -n
./misc.c:760:           && mkdir(filename, 0700) == 0) {
./misc.c:804:       unlink(xterm_cursor_theme);
./misc.c:805:       rmdir(my_path);

The diff below should fix it:

Index: main.c
===================================================================
RCS file: /cvs/xenocara/app/xterm/main.c,v
retrieving revision 1.43
diff -u -p -u -p -r1.43 main.c
--- main.c      29 Mar 2018 20:22:05 -0000      1.43
+++ main.c      28 Jul 2018 18:48:15 -0000
@@ -2782,12 +2782,12 @@ main(int argc, char *argv[]ENVP_ARG)
         if (data &&
             (strstr(data, "exec-formatted") || strstr(data, 
"exec-selectable"))) {
 
-            if (pledge("stdio rpath wpath id proc exec tty", NULL) == -1) {
+            if (pledge("stdio rpath cpath wpath id proc exec tty", NULL) == 
-1) {
                 xtermWarning("pledge\n");
                 exit(1);
             }
         } else {
-            if (pledge("stdio rpath wpath id proc tty", NULL) == -1) {
+            if (pledge("stdio rpath cpath wpath id proc tty", NULL) == -1) {
                xtermWarning("pledge\n");
                exit(1);
            }

Reply via email to