Discussion:
font files not read/processed when they are symlinks?
b***@units.it
2018-09-24 11:51:02 UTC
Permalink
hello

apologies if I'm missing something blatant here...

Might it be that font files are NOT read/loaded by the X server when
they are symbolic links?

I have recently migrated from a fontpath layout where all files were
"physically" (ie "real" regular files) present under the font
directories
/usr/Xorg/share/fonts/X11/{100dpi,75dpi,OTF,TTF,Type1,cyrillic,encodings,misc,util}
to a "stow based" (https://www.gnu.org/software/stow/) fontpath layout
where all files under the font directories
/usr/share/fonts/X11/{100dpi,75dpi,OTF,TTF,Type1,cyrillic,encodings,misc,util}
are actually symlinks to individual, package specific locations
elsewhere in the system.

After the switch (including, of course, editing xorg.conf for the new
font paths under /usr/share/fonts/X11 and running
mkfontscale/mkfontdir in the /usr/share/fonts/X11/* dirs) xlsfonts
shows me only ~250 fonts (where it showed ~5000 in the previous
layout) and clients relying on xserver for fonts look more or less
ugly.

If I edit xorg.conf and point the FontPath entries to the directories
where the *actual* font files live (everything else unchanged and
mkfontscale/mkfontdir run in the corresponding individual dirs), then
everything is restored back to normality (~5000 fonts listed by
xlsfonts, clients with usual look etc)

AFAICS, it looks like font files aren't read/processed correctly by
the server when they are symlinks: is that possible?

After googling around without success, I have tried to dig into the
server (and libX11) sources to find where the font files are actually
opened and read, but I got lost in the jungle...

Could anybody point me to the code (xserver,libX11,...?) where font
files parsing/loading is actually performed?

Or simply answer the question regarding the different results I obtain
when font files are/aren't symbolic links?

thanks a lot for any hint

ciao
gabriele
_______________________________________________
***@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listin
Alan Coopersmith
2018-09-24 15:25:05 UTC
Permalink
Post by b***@units.it
Might it be that font files are NOT read/loaded by the X server when
they are symbolic links?
Correct - since the X server is often run with raised privileges, it
was fixed last year to use O_NOFOLLOW to not follow symbolic links
when handling font files:

https://gitlab.freedesktop.org/xorg/lib/libxfont/commit/7b377456f95d2ec3ead40f4fb74ea620191f88c8
--
-Alan Coopersmith- ***@oracle.com
Oracle Solaris Engineering - https://blogs.oracle.com/alanc
_______________________________________________
***@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address
b***@units.it
2018-09-24 15:47:25 UTC
Permalink
Post by Alan Coopersmith
Correct - since the X server is often run with raised privileges, it
was fixed last year to use O_NOFOLLOW to not follow symbolic links
https://gitlab.freedesktop.org/xorg/lib/libxfont/commit/7b377456f95d2ec3ead40
f4fb74ea620191f88c8
thanks a lot indeed!

That clarifies everything: actually I wasn't 100% sure that the reason
was this; now I can "close" the issue: no stow with X font files.

ciao
-g
_______________________________________________
***@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_add

Loading...