Bug 225125 - symbolic link X font was not recognize (japanese fonts)
Summary: symbolic link X font was not recognize (japanese fonts)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-13 00:09 UTC by Shigeharu TAKENO
Modified: 2018-04-15 14:01 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shigeharu TAKENO 2018-01-13 00:09:41 UTC
At 2017-10, I updated to FreeBSD 11.1 from 10.3 by freebsd-update, portsnap, and portupgrade. It was no problem for font.
I used portnap and portupgrade at 2018-10 again, then some japanese x font are not recognized:

  japanese/font-elisa8, japaese/font-naga10, japanese/font-shinonome,
  japanese/font-kanji18, japanese/font-kappa20, japanese/font-kanji26

These fonts are listed by "xlsfonts" but not "xlsfonts -l", and cannot be displayed by xfd and xfontsel. But fonts of japanese/font-jisx0213 are
displayed.

Current Xorg may not recognize symbolic link to the real font file (.pcf.gz).
In fact, for example, the font file /usr/local/share/fonts/misc/shnmk14min.pcf.gz is installed as a symbolic link to /usr/local/share/font-shinonome/shnmk14min.pcf.gz and can not be used. If I copy the real file to /usr/local/share/fonts/misc, or change symbolic link to hard link, we can use it.

To solve the problem, to change these ports to copy the font files to /usr/local/share/fonts/misc/ directly, or to make hard link instead of symbolic link, while Xorg don't recognize symlink font files.
Comment 1 Yasuhito FUTATSUKI 2018-02-18 20:03:26 UTC
(In reply to Shigeharu TAKENO from comment #0)
> Current Xorg may not recognize symbolic link to the real font file (.pcf.gz).

After upgrading x11-fonts/libXfont from 1.5.2 to 1.5.4, it also happens at my environment. Perhaps it is caused by fix for CVE-2017-16611, open files with O_NOFOLLOW.
Comment 2 Yasuhito FUTATSUKI 2018-02-19 06:41:32 UTC
(In reply to Yasuhito FUTATSUKI from comment #1)
> After upgrading x11-fonts/libXfont from 1.5.2 to 1.5.4, it also happens at my environment. Perhaps it is caused by fix for CVE-2017-16611, open files with O_NOFOLLOW.

When I modified src/fontfile/fileio.c in libXfont 1.5.4 not to use O_NOFOLLOW, applications can use fonts again.

Here is a list of ports origin I found using symlinks.
(result of
   find /usr/local/share/fonts -type -l -name '*.pcf.gz' | xargs -n 1 pkg which -o -q | sort | uniq
)

japanese/font-elisa10
japanese/font-elisa8
japanese/font-kaname12
japanese/font-kanji18
japanese/font-kanji26
japanese/font-kappa20
japanese/font-mona
japanese/font-naga10
japanese/font-shinonome
Comment 3 WATANABE Kazuhiro 2018-02-25 03:00:14 UTC
Hi, all.

I have been making patches to fix the problem for the following ports:

(In reply to Yasuhito FUTATSUKI from comment #2)
> japanese/font-elisa10
> japanese/font-elisa8
> japanese/font-kaname12
> japanese/font-kanji18
> japanese/font-kanji26
> japanese/font-kappa20
> japanese/font-mona
> japanese/font-naga10
> japanese/font-shinonome

and

 japanese/font-ayu18
 japanese/font-ayu20
 japanese/font-mplus-bitmap

The outline is:

(1) Install font files to ${FONTSDIR} instead of ${DATADIR}.
(2) Stop to make symbolic links from the font files to 
    ${PREFIX}/share/fonts/misc/, which is found in the default font path.
(3) Add (or revert) pkg-message.in to display additional font path settings:

| *******************************************************************
| You can start using the font(s) by following these instructions:
| 
| Either type the following in an X terminal:
| 
|         xset fp+ %%FONTSDIR%%
|         xset fp rehash
| 
| Or, more permanently, add the following line to the "Files" section
| of your X.Org configuration file (typically /etc/X11/xorg.conf):
| 
|         FontPath "%%FONTSDIR%%/"
| 
| then restart X.
| *******************************************************************

If there is a more better solution, please tell me.
Comment 4 WATANABE Kazuhiro 2018-03-11 12:58:46 UTC
I've posted the following bug reports:

Bug 226511: for japanese/font-ayu18 japanese/font-ayu20 japanese/font-elisa10 japanese/font-shinonome
Bug 226515: for japanese/font-elisa8
Bug 226516: for japanese/font-kaname12 japanese/font-naga10
Bug 226517: for japanese/font-kanji18 japanese/font-kanji26
Bug 226518: for japanese/font-kappa20
Bug 226519: for japanese/font-mona
Bug 226520: for japanese/font-mplus-bitmap
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-03-11 14:57:42 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Mar 11 14:57:29 UTC 2018
New revision: 464177
URL: https://svnweb.freebsd.org/changeset/ports/464177

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226519 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]

Changes:
  head/japanese/font-mona/Makefile
  head/japanese/font-mona/files/patch-Makefile
  head/japanese/font-mona/files/pkg-install.in
  head/japanese/font-mona/files/pkg-message.in
  head/japanese/font-mona/pkg-plist
Comment 6 MANTANI Nobutaka freebsd_committer freebsd_triage 2018-03-11 15:10:09 UTC
I have fixed font-mona port. Thank you Takeno-san, Futatsuki-san and Watanabe-san!
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-03-25 14:08:42 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Mar 25 14:07:49 UTC 2018
New revision: 465516
URL: https://svnweb.freebsd.org/changeset/ports/465516

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226516 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> (maintainer) [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]

Changes:
  head/japanese/font-kaname12/Makefile
  head/japanese/font-kaname12/files/Makefile.in
  head/japanese/font-kaname12/files/pkg-install.in
  head/japanese/font-kaname12/files/pkg-message.in
  head/japanese/font-kaname12/pkg-plist
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-03-25 14:19:00 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Mar 25 14:18:18 UTC 2018
New revision: 465518
URL: https://svnweb.freebsd.org/changeset/ports/465518

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226516 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> (maintainer) [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]

Changes:
  head/japanese/font-naga10/Makefile
  head/japanese/font-naga10/files/Makefile.in
  head/japanese/font-naga10/files/pkg-install.in
  head/japanese/font-naga10/files/pkg-message.in
  head/japanese/font-naga10/pkg-plist
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-03-25 14:42:27 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Mar 25 14:42:13 UTC 2018
New revision: 465520
URL: https://svnweb.freebsd.org/changeset/ports/465520

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Bump PORTREVISION.
  - Set submitter as maintainer.

  PR:		225125 [1], 226517 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]

Changes:
  head/japanese/font-kanji18/Makefile
  head/japanese/font-kanji18/files/Makefile.in
  head/japanese/font-kanji18/files/pkg-message.in
  head/japanese/font-kanji18/pkg-plist
  head/japanese/font-kanji26/pkg-plist
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-03-25 16:13:56 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Mar 25 16:13:32 UTC 2018
New revision: 465526
URL: https://svnweb.freebsd.org/changeset/ports/465526

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226518 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]
  Approved by:	maintainer

Changes:
  head/japanese/font-kappa20/Makefile
  head/japanese/font-kappa20/files/Makefile.in
  head/japanese/font-kappa20/files/pkg-install.in
  head/japanese/font-kappa20/files/pkg-message.in
  head/japanese/font-kappa20/pkg-plist
Comment 11 commit-hook freebsd_committer freebsd_triage 2018-04-08 13:13:53 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Apr  8 13:13:28 UTC 2018
New revision: 466800
URL: https://svnweb.freebsd.org/changeset/ports/466800

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226515 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]
  Approved by:	maintainer timeout (two weeks)

Changes:
  head/japanese/font-elisa8/Makefile
  head/japanese/font-elisa8/files/Makefile.in
  head/japanese/font-elisa8/files/pkg-install.in
  head/japanese/font-elisa8/files/pkg-message.in
  head/japanese/font-elisa8/pkg-plist
Comment 12 commit-hook freebsd_committer freebsd_triage 2018-04-15 13:47:17 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Apr 15 13:46:58 UTC 2018
New revision: 467393
URL: https://svnweb.freebsd.org/changeset/ports/467393

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226520 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]
  Approved by:	maintainer timeout (one month)

Changes:
  head/japanese/font-mplus-bitmap/Makefile
  head/japanese/font-mplus-bitmap/files/pkg-install.in
  head/japanese/font-mplus-bitmap/files/pkg-message.in
  head/japanese/font-mplus-bitmap/pkg-plist
Comment 13 commit-hook freebsd_committer freebsd_triage 2018-04-15 13:52:28 UTC
A commit references this bug:

Author: nobutaka
Date: Sun Apr 15 13:52:23 UTC 2018
New revision: 467394
URL: https://svnweb.freebsd.org/changeset/ports/467394

Log:
  - Install font files to ${FONTSDIR} instead of ${DATADIR}.
  - Stop to make symbolic links from the font files to
    ${PREFIX}/share/fonts/misc/, which is found in the default
    font path, because recent libXfont does not follow symbolic
    links.
  - Add pkg-message.in to show additional font path settings.
  - Remove unnecessary pkg-install.in.
  - Bump PORTREVISION.

  PR:		225125 [1], 226511 [2]
  Submitted by:	WATANABE Kazuhiro <CQG00620@nifty.ne.jp> [2]
  Reported by:	Shigeharu TAKENO <shige@iee.niit.ac.jp> [1]
  Approved by:	maintainer timeout (one month)

Changes:
  head/japanese/font-ayu18/Makefile
  head/japanese/font-ayu18/files/Makefile.in
  head/japanese/font-ayu18/files/pkg-message.in
  head/japanese/font-ayu18/pkg-plist
  head/japanese/font-ayu20/Makefile
  head/japanese/font-ayu20/files/Makefile.in
  head/japanese/font-ayu20/files/pkg-install.in
  head/japanese/font-ayu20/files/pkg-message.in
  head/japanese/font-ayu20/pkg-plist
  head/japanese/font-elisa10/Makefile
  head/japanese/font-elisa10/files/Makefile.in
  head/japanese/font-elisa10/files/pkg-install.in
  head/japanese/font-elisa10/files/pkg-message.in
  head/japanese/font-shinonome/Makefile
  head/japanese/font-shinonome/files/pkg-install.in
  head/japanese/font-shinonome/files/pkg-message.in
  head/japanese/font-shinonome/pkg-plist
Comment 14 MANTANI Nobutaka freebsd_committer freebsd_triage 2018-04-15 14:01:24 UTC
Finally all relevant ports have been fixed.
Thank you for the great work, Watanabe-san!