unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30655: xset(1) not accepting symlink to font path
@ 2018-02-28 21:54 Marco van Hulten
  2018-03-01 16:52 ` Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Marco van Hulten @ 2018-02-28 21:54 UTC (permalink / raw)
  To: 30655

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@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@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@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30655: xset(1) not accepting symlink to font path
  2018-02-28 21:54 bug#30655: xset(1) not accepting symlink to font path Marco van Hulten
@ 2018-03-01 16:52 ` Ludovic Courtès
  2018-03-01 21:17   ` Marco van Hulten
  2018-03-01 17:47 ` Alex Kost
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2018-03-01 16:52 UTC (permalink / raw)
  To: Marco van Hulten; +Cc: 30655

[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]

Hi Marco,

Marco van Hulten <marco@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@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@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@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 440 bytes --]

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}

[-- Attachment #3: Type: text/plain, Size: 26 bytes --]


?

Thanks,
Ludo’.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#30655: xset(1) not accepting symlink to font path
  2018-02-28 21:54 bug#30655: xset(1) not accepting symlink to font path Marco van Hulten
  2018-03-01 16:52 ` Ludovic Courtès
@ 2018-03-01 17:47 ` Alex Kost
  2018-03-01 21:27   ` Marco van Hulten
       [not found] ` <handler.30655.D30655.151999474622089.notifdone@debbugs.gnu.org>
  2020-06-17  2:47 ` bug#30655: xset(1) not accepting symlink to font path Royce Strange
  3 siblings, 1 reply; 9+ messages in thread
From: Alex Kost @ 2018-03-01 17:47 UTC (permalink / raw)
  To: Marco van Hulten; +Cc: 30655

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@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@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@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30655: xset(1) not accepting symlink to font path
  2018-03-01 16:52 ` Ludovic Courtès
@ 2018-03-01 21:17   ` Marco van Hulten
  2018-03-02 12:45     ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Marco van Hulten @ 2018-03-01 21:17 UTC (permalink / raw)
  To: Ludovic Courtès, 30655

Ludovic—

Je  1 mrt 17:52 skribis Ludovic:
> Marco van Hulten <marco@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@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@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@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)?

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#30655: xset(1) not accepting symlink to font path
  2018-03-01 17:47 ` Alex Kost
@ 2018-03-01 21:27   ` Marco van Hulten
  0 siblings, 0 replies; 9+ messages in thread
From: Marco van Hulten @ 2018-03-01 21:27 UTC (permalink / raw)
  To: Alex Kost; +Cc: 30655

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30655: xset(1) not accepting symlink to font path
  2018-03-01 21:17   ` Marco van Hulten
@ 2018-03-02 12:45     ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-03-02 12:45 UTC (permalink / raw)
  To: Marco van Hulten; +Cc: 30655-done

Hello,

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

> Ludovic—
>
> Je  1 mrt 17:52 skribis Ludovic:
>> Marco van Hulten <marco@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@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@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@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’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30655: closed (Re: bug#30655: xset(1) not accepting symlink to font path)
       [not found] ` <handler.30655.D30655.151999474622089.notifdone@debbugs.gnu.org>
@ 2018-03-03 15:26   ` Marco van Hulten
  2018-03-04 21:41     ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Marco van Hulten @ 2018-03-03 15:26 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 30655

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30655: closed (Re: bug#30655: xset(1) not accepting symlink to font path)
  2018-03-03 15:26   ` bug#30655: closed (Re: bug#30655: xset(1) not accepting symlink to font path) Marco van Hulten
@ 2018-03-04 21:41     ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-03-04 21:41 UTC (permalink / raw)
  To: Marco van Hulten; +Cc: 30655

Hi,

Marco van Hulten <marco@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’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30655: xset(1) not accepting symlink to font path
  2018-02-28 21:54 bug#30655: xset(1) not accepting symlink to font path Marco van Hulten
                   ` (2 preceding siblings ...)
       [not found] ` <handler.30655.D30655.151999474622089.notifdone@debbugs.gnu.org>
@ 2020-06-17  2:47 ` Royce Strange
  3 siblings, 0 replies; 9+ messages in thread
From: Royce Strange @ 2020-06-17  2:47 UTC (permalink / raw)
  To: 30655-done

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.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-17  2:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 21:54 bug#30655: xset(1) not accepting symlink to font path Marco van Hulten
2018-03-01 16:52 ` Ludovic Courtès
2018-03-01 21:17   ` Marco van Hulten
2018-03-02 12:45     ` Ludovic Courtès
2018-03-01 17:47 ` Alex Kost
2018-03-01 21:27   ` Marco van Hulten
     [not found] ` <handler.30655.D30655.151999474622089.notifdone@debbugs.gnu.org>
2018-03-03 15:26   ` bug#30655: closed (Re: bug#30655: xset(1) not accepting symlink to font path) Marco van Hulten
2018-03-04 21:41     ` Ludovic Courtès
2020-06-17  2:47 ` bug#30655: xset(1) not accepting symlink to font path Royce Strange

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).