GNU bug report logs - #30655
xset(1) not accepting symlink to font path

Previous Next

Package: guix;

Reported by: Marco van Hulten <marco <at> hulten.org>

Date: Wed, 28 Feb 2018 21:55:01 UTC

Severity: normal

Done: Royce Strange <royball <at> disroot.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30655 in the body.
You can then email your comments to 30655 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Wed, 28 Feb 2018 21:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marco van Hulten <marco <at> hulten.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 28 Feb 2018 21:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marco van Hulten <marco <at> hulten.org>
To: bug-guix <at> gnu.org
Subject: xset(1) not accepting symlink to font path
Date: Wed, 28 Feb 2018 22:54:29 +0100
Hello,

When I follow the manual at
https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#X11-Fonts ,
I get the message that there is something wrong with the directory I'm
trying to add it:


gast <at> graviton ~$ xset +fp ~/.guix-profile/share/fonts/truetype
xset:  bad font path element (#0), possible causes are:
    Directory does not exist or has wrong permissions
    Directory missing fonts.dir
    Incorrect font server address or syntax
gast <at> graviton ~$ ls -l ~/.guix-profile/share/fonts/truetype/fonts.dir 
lrwxrwxrwx 2 root root 84 Jan  1  1970 /home/gast/.guix-profile/share/fonts/truetype/fonts.dir -> /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype/fonts.dir
gast <at> graviton ~$ xset +fp /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype


The last command exits with code 0.  Apparently, xset(1) does not want
me to add symlink(2)s that point to valid directories.

—Marco




Information forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Thu, 01 Mar 2018 16:53:01 GMT) Full text and rfc822 format available.

Message #8 received at 30655 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marco van Hulten <marco <at> hulten.org>
Cc: 30655 <at> debbugs.gnu.org
Subject: Re: bug#30655: xset(1) not accepting symlink to font path
Date: Thu, 01 Mar 2018 17:52:09 +0100
[Message part 1 (text/plain, inline)]
Hi Marco,

Marco van Hulten <marco <at> hulten.org> skribis:

> When I follow the manual at
> https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#X11-Fonts ,
> I get the message that there is something wrong with the directory I'm
> trying to add it:
>
>
> gast <at> graviton ~$ xset +fp ~/.guix-profile/share/fonts/truetype
> xset:  bad font path element (#0), possible causes are:
>     Directory does not exist or has wrong permissions
>     Directory missing fonts.dir
>     Incorrect font server address or syntax
> gast <at> graviton ~$ ls -l ~/.guix-profile/share/fonts/truetype/fonts.dir 
> lrwxrwxrwx 2 root root 84 Jan  1  1970 /home/gast/.guix-profile/share/fonts/truetype/fonts.dir -> /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype/fonts.dir
> gast <at> graviton ~$ xset +fp /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype
>
>
> The last command exits with code 0.  Apparently, xset(1) does not want
> me to add symlink(2)s that point to valid directories.

Would this be a good fix:

[Message part 2 (text/x-patch, inline)]
diff --git a/doc/guix.texi b/doc/guix.texi
index 24db16761..35221ff94 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1572,7 +1572,7 @@ To be able to use such full names for the TrueType fonts installed in
 your Guix profile, you need to extend the font path of the X server:
 
 @example
-xset +fp ~/.guix-profile/share/fonts/truetype
+xset +fp `readlink -f ~/.guix-profile/share/fonts/truetype`
 @end example
 
 @cindex @code{xlsfonts}
[Message part 3 (text/plain, inline)]
?

Thanks,
Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Thu, 01 Mar 2018 17:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 30655 <at> debbugs.gnu.org (full text, mbox):

From: Alex Kost <alezost <at> gmail.com>
To: Marco van Hulten <marco <at> hulten.org>
Cc: 30655 <at> debbugs.gnu.org
Subject: Re: bug#30655: xset(1) not accepting symlink to font path
Date: Thu, 01 Mar 2018 20:47:02 +0300
Marco van Hulten (2018-02-28 22:54 +0100) wrote:

> Hello,
>
> When I follow the manual at
> https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#X11-Fonts ,
> I get the message that there is something wrong with the directory I'm
> trying to add it:
>
>
> gast <at> graviton ~$ xset +fp ~/.guix-profile/share/fonts/truetype
> xset:  bad font path element (#0), possible causes are:
>     Directory does not exist or has wrong permissions
>     Directory missing fonts.dir
>     Incorrect font server address or syntax
> gast <at> graviton ~$ ls -l ~/.guix-profile/share/fonts/truetype/fonts.dir 
> lrwxrwxrwx 2 root root 84 Jan 1 1970
> /home/gast/.guix-profile/share/fonts/truetype/fonts.dir ->
> /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype/fonts.dir
> gast <at> graviton ~$ xset +fp /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype
>
>
> The last command exits with code 0.  Apparently, xset(1) does not want
> me to add symlink(2)s that point to valid directories.

Sounds familiar.  I recall I dealt with this problem some time ago.  In
short, it was introduced by one of the dependencies of X server
(libXfont):

  https://cgit.freedesktop.org/xorg/lib/libXfont/commit/?id=7b377456f95d2ec3ead40f4fb74ea620191f88c8

X server allowed to use symlinks for fonts before that commit,
but not anymore.

I fixed it on my side simply by making 'my-xorg-server' package
that uses a "fixed" version of libxfont (that supports symlinks).

If anyone is interested, I also wrote a descriptive commit message here:

  https://notabug.org/alezost/guix-config/commit/161d5e2e36e53c0d9c46181e10e1595e607748dd

-- 
Alex




Information forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Thu, 01 Mar 2018 21:18:02 GMT) Full text and rfc822 format available.

Message #14 received at 30655 <at> debbugs.gnu.org (full text, mbox):

From: Marco van Hulten <marco <at> hulten.org>
To: ludo <at> gnu.org (Ludovic Courtès), 30655 <at> debbugs.gnu.org
Subject: Re: bug#30655: xset(1) not accepting symlink to font path
Date: Thu, 01 Mar 2018 22:17:09 +0100
Ludovic—

Je  1 mrt 17:52 skribis Ludovic:
> Marco van Hulten <marco <at> hulten.org> skribis:
> 
> > When I follow the manual at
> > https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#X11-Fonts ,
> > I get the message that there is something wrong with the directory I'm
> > trying to add it:
> >
> >
> > gast <at> graviton ~$ xset +fp ~/.guix-profile/share/fonts/truetype
> > xset:  bad font path element (#0), possible causes are:
> >     Directory does not exist or has wrong permissions
> >     Directory missing fonts.dir
> >     Incorrect font server address or syntax
> > gast <at> graviton ~$ ls -l ~/.guix-profile/share/fonts/truetype/fonts.dir 
> > lrwxrwxrwx 2 root root 84 Jan  1  1970 /home/gast/.guix-profile/share/fonts/truetype/fonts.dir -> /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype/fonts.dir
> > gast <at> graviton ~$ xset +fp /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype
> >
> >
> > The last command exits with code 0.  Apparently, xset(1) does not want
> > me to add symlink(2)s that point to valid directories.  
> 
> Would this be a good fix:

More or less, but it is fonts.dir that points to the right location
though we need the base dir of that, so the patch must be:


diff --git a/doc/guix.texi b/doc/guix.texi
index 24db16761..35221ff94 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1572,7 +1572,7 @@ To be able to use such full names for the
TrueType fonts installed in your Guix profile, you need to extend the
font path of the X server: 
 @example
-xset +fp ~/.guix-profile/share/fonts/truetype
+xset +fp $(dirname $(readlink -f
~/.guix-profile/share/fonts/truetype/fonts.dir)) @end example
 
 @cindex @code{xlsfonts}


The issue is apparently not really a bug but more of an obvious side
effect of the security improvement of libXfont as Alex Kost pointed out.
Changing the documentation as above handles this issue well.

—Marco

P.S. How do you make a patch appear as both a file *and* as text within
the body of an e-mail (that's how Claws Mail presented it to me)?




Information forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Thu, 01 Mar 2018 21:28:02 GMT) Full text and rfc822 format available.

Message #17 received at 30655 <at> debbugs.gnu.org (full text, mbox):

From: Marco van Hulten <marco <at> hulten.org>
To: Alex Kost <alezost <at> gmail.com>
Cc: 30655 <at> debbugs.gnu.org
Subject: Re: bug#30655: xset(1) not accepting symlink to font path
Date: Thu, 01 Mar 2018 22:27:35 +0100
Alex—

Je  1 mrt 20:47 skribis Alex:
> I fixed it on my side simply by making 'my-xorg-server' package
> that uses a "fixed" version of libxfont (that supports symlinks).
> 
> If anyone is interested, I also wrote a descriptive commit message here:
> 
>   https://notabug.org/alezost/guix-config/commit/161d5e2e36e53c0d9c46181e10e1595e607748dd

That's an interesting approach as well!  Of course, the change in the
documentation as Ludo' proposed is a bit less invasive :-)

I wonder if the libXfont security issue couldn't be solved in a way
such that it can still handle symlinks.  But it is not something to
dwell over long: the documentation change is sufficient in my opinion.

—Marco




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Fri, 02 Mar 2018 12:46:02 GMT) Full text and rfc822 format available.

Notification sent to Marco van Hulten <marco <at> hulten.org>:
bug acknowledged by developer. (Fri, 02 Mar 2018 12:46:04 GMT) Full text and rfc822 format available.

Message #22 received at 30655-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marco van Hulten <marco <at> hulten.org>
Cc: 30655-done <at> debbugs.gnu.org
Subject: Re: bug#30655: xset(1) not accepting symlink to font path
Date: Fri, 02 Mar 2018 13:45:41 +0100
Hello,

Marco van Hulten <marco <at> hulten.org> skribis:

> Ludovic—
>
> Je  1 mrt 17:52 skribis Ludovic:
>> Marco van Hulten <marco <at> hulten.org> skribis:
>> 
>> > When I follow the manual at
>> > https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#X11-Fonts ,
>> > I get the message that there is something wrong with the directory I'm
>> > trying to add it:
>> >
>> >
>> > gast <at> graviton ~$ xset +fp ~/.guix-profile/share/fonts/truetype
>> > xset:  bad font path element (#0), possible causes are:
>> >     Directory does not exist or has wrong permissions
>> >     Directory missing fonts.dir
>> >     Incorrect font server address or syntax
>> > gast <at> graviton ~$ ls -l ~/.guix-profile/share/fonts/truetype/fonts.dir 
>> > lrwxrwxrwx 2 root root 84 Jan  1  1970 /home/gast/.guix-profile/share/fonts/truetype/fonts.dir -> /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype/fonts.dir
>> > gast <at> graviton ~$ xset +fp /gnu/store/5kp6hj8mk6pgfl4x3cgabl7z379jyyrl-fonts-dir/share/fonts/truetype
>> >
>> >
>> > The last command exits with code 0.  Apparently, xset(1) does not want
>> > me to add symlink(2)s that point to valid directories.  
>> 
>> Would this be a good fix:
>
> More or less, but it is fonts.dir that points to the right location
> though we need the base dir of that, so the patch must be:
>
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 24db16761..35221ff94 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -1572,7 +1572,7 @@ To be able to use such full names for the
> TrueType fonts installed in your Guix profile, you need to extend the
> font path of the X server: 
>  @example
> -xset +fp ~/.guix-profile/share/fonts/truetype
> +xset +fp $(dirname $(readlink -f ~/.guix-profile/share/fonts/truetype/fonts.dir))
>  @end example

Actually commit 07ec349229 that I just pushed fixes this very line.  So
I guess we’re done?

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Sat, 03 Mar 2018 15:27:02 GMT) Full text and rfc822 format available.

Message #25 received at 30655 <at> debbugs.gnu.org (full text, mbox):

From: Marco van Hulten <marco <at> hulten.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 30655 <at> debbugs.gnu.org
Subject: Re: bug#30655: closed (Re: bug#30655: xset(1) not accepting symlink to
 font path)
Date: Sat, 03 Mar 2018 16:26:14 +0100
Ludo'—

Je  2 mrt 12:46 skribis GNU:
> > diff --git a/doc/guix.texi b/doc/guix.texi
> > index 24db16761..35221ff94 100644
> > --- a/doc/guix.texi
> > +++ b/doc/guix.texi
> > @@ -1572,7 +1572,7 @@ To be able to use such full names for the
> > TrueType fonts installed in your Guix profile, you need to extend the
> > font path of the X server: 
> >  @example
> > -xset +fp ~/.guix-profile/share/fonts/truetype
> > +xset +fp $(dirname $(readlink -f ~/.guix-profile/share/fonts/truetype/fonts.dir))
> >  @end example  
> 
> Actually commit 07ec349229 that I just pushed fixes this very line.  So
> I guess we’re done?

I don't think so, because I just did a 'git pull', and found that the
old patch had been applied (the one with `readlink... that doesn't
work, instead of the above with $(dirname $(readlink...) which works.

Apropos, how often are the HTML pages generated from the repository and
put online?

—Marco




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 03 Mar 2018 17:37:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#30655; Package guix. (Sun, 04 Mar 2018 21:42:02 GMT) Full text and rfc822 format available.

Message #30 received at 30655 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marco van Hulten <marco <at> hulten.org>
Cc: 30655 <at> debbugs.gnu.org
Subject: Re: bug#30655: closed (Re: bug#30655: xset(1) not accepting symlink
 to font path)
Date: Sun, 04 Mar 2018 22:41:13 +0100
Hi,

Marco van Hulten <marco <at> hulten.org> skribis:

> Je  2 mrt 12:46 skribis GNU:
>> > diff --git a/doc/guix.texi b/doc/guix.texi
>> > index 24db16761..35221ff94 100644
>> > --- a/doc/guix.texi
>> > +++ b/doc/guix.texi
>> > @@ -1572,7 +1572,7 @@ To be able to use such full names for the
>> > TrueType fonts installed in your Guix profile, you need to extend the
>> > font path of the X server: 
>> >  @example
>> > -xset +fp ~/.guix-profile/share/fonts/truetype
>> > +xset +fp $(dirname $(readlink -f ~/.guix-profile/share/fonts/truetype/fonts.dir))
>> >  @end example  
>> 
>> Actually commit 07ec349229 that I just pushed fixes this very line.  So
>> I guess we’re done?
>
> I don't think so, because I just did a 'git pull', and found that the
> old patch had been applied (the one with `readlink... that doesn't
> work, instead of the above with $(dirname $(readlink...) which works.

Oops, really fixed now (will push shortly.)

> Apropos, how often are the HTML pages generated from the repository and
> put online?

At each new release.

Thanks,
Ludo’.




Reply sent to Royce Strange <royball <at> disroot.org>:
You have taken responsibility. (Wed, 17 Jun 2020 02:49:02 GMT) Full text and rfc822 format available.

Notification sent to Marco van Hulten <marco <at> hulten.org>:
bug acknowledged by developer. (Wed, 17 Jun 2020 02:49:02 GMT) Full text and rfc822 format available.

Message #35 received at 30655-done <at> debbugs.gnu.org (full text, mbox):

From: Royce Strange <royball <at> disroot.org>
To: 30655-done <at> debbugs.gnu.org
Subject: xset(1) not accepting symlink to font path
Date: Tue, 16 Jun 2020 21:47:59 -0500
Hello.

It has been a while but the manual does include the updated xset command:
https://guix.gnu.org/manual/en/guix.html#X11-Fonts

Going to go ahead and close.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Jul 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 257 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.