Hi Matthieu,

On Fri, Aug 05, 2022 at 06:46:42PM +0200, Walter Alejandro Iglesias wrote:
> Now, after applying your patch, setting FONTCONFIG_FILE and
> FONTCONFIG_PATH to my home config dir and file, xterm loads the xft font
> correctly but the error appears again.  I don't understand why since it
> seemed to me to see in the code (main.c) that home directory as well as
> the xdg direcories are also unveiled.

Since FONTCONFIG_FILE is a file and not a directory I didn't know how
to solve it in the same fashion than in the code.  The nearest solution I
found is setting FONTCONFIG_PATH:

Index: main.c
===================================================================
RCS file: /cvs/xenocara/app/xterm/main.c,v
retrieving revision 1.57
diff -u -p -r1.57 main.c
--- main.c      22 May 2022 14:43:01 -0000      1.57
+++ main.c      6 Aug 2022 12:44:13 -0000
@@ -2967,7 +2967,14 @@ main(int argc, char *argv[]ENVP_ARG)
                        unveil(xdgfile, "r"); 
            }
 
+            if ((env = getenv("FONTCONFIG_PATH"))) {
+                char fontconfigfile[PATH_MAX];
+                if (snprintf(fontconfigfile, sizeof fontconfigfile,
+                   "%s/fonts.conf", env) <= sizeof(fontconfigfile))
+                       unveil(fontconfigfile, "r");
+            }
            unveil("/usr/X11R6", "r");
+           unveil("/etc/fonts", "r");
             unveil("/usr/local/share/fonts", "r");
            unveil("/var/cache/fontconfig", "r");
            unveil("/usr/local/share/icons", "r");


Reply via email to