#877795 fontforge: FTBFS on hurd-i386: PATH_MAX undeclared

Package:
src:fontforge
Source:
fontforge
Submitter:
"Aaron M. Ucko"
Date:
2022-06-16 09:33:02 UTC
Severity:
important
Tags:
#877795#5
Date:
2017-10-05 19:02:05 UTC
From:
To:
Builds of recent fontforge versions for hurd-i386 (admittedly not a
release architecture) have been failing:

  /<<PKGBUILDDIR>>/./gutils/fsys.c:770:22: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'INT8_MAX'?

The Hurd has no hard PATH_MAX; best practice is to check the relevant
file system's _PC_PATH_MAX via pathconf, which can entail allocating
buffers dynamically.  Alternatively, you can supply your own fallback
constant, typically 4096.

Could you please take a look?  Please note that there may be other
occurrences of PATH_MAX or other portability issues; I haven't
specifically checked.

Thanks!

#877795#10
Date:
2017-10-05 22:48:44 UTC
From:
To:
That "best practice" is a myth; _PC_PATH_MAX merely returns this same
hardcoded value via a roundabout way.  And allocating a buffer of only that
size means you'll have a buffer overflow or truncation, as paths can be much
longer than PATH_MAX.  This is why Hurd folks insist on not adding this
#define -- every use of it is a bug.

On the other hand, I can think of no valid use case for editing a font in a
path 4096 bytes deep.  Thus, artificially limitting path length in FontForge
sounds reasonable to me.


Meow!

#877795#13
Date:
2021-01-15 07:57:49 UTC
From:
To:
Hello,

Bug #877795 in fontforge reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/fonts-team/fontforge/-/commit/94a00d6ebe9d83e788004b779c75eb85d248df14
------------------------------------------------------------------------
Define PATH_MAX and MAXPATHLEN for GNU/Hurd compatibility

See debian/patches/0004-hurd-compatibility.patch

Closes: #877795
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/877795

#877795#20
Date:
2021-01-15 08:21:13 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
fontforge, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 877795@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Anthony Fok <foka@debian.org> (supplier of updated fontforge package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 15 Jan 2021 00:41:32 -0700
Source: fontforge
Architecture: source
Version: 1:20201107~dfsg-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Fonts Task Force <debian-fonts@lists.debian.org>
Changed-By: Anthony Fok <foka@debian.org>
Closes: 877795 976736 977954
Changes:
 fontforge (1:20201107~dfsg-3) unstable; urgency=medium
 .
   [ Helmut Grohne ]
   * Reduce Build-Depends via Build-Depends-Indep. (Closes: #977954)
 .
   [ Anthony Fok ]
   * debian/control:
     - Remove uthash-dev and libxt-dev from build-dependency as they are not
       used any more by the build.  Thanks to Helmut Grohne for the suggestion.
     - Specify that fontforge "Provides: fontforge-nox" (Closes: #976736)
     - debian/control: Remove "XS-Python-Version: all" which was for Python 2
     - Bump Standards-Version to 4.5.1 (no change)
   * Define PATH_MAX and MAXPATHLEN to fix FTBFS on GNU/Hurd.
     See debian/patches/0004-hurd-compatibility.patch (Closes: #877795)
   * 2003_avoid_privacy_breach.patch: Fix "more than 2 sections in header"
     error as reported by "cme fix dpkg"
   * debian/fontforge*.install: Sort lines in alphabetical order, by
     "cme fix dpkg"
Checksums-Sha1:
 b3071c4acb6805e793f85cef6723d443d5c23273 2992 fontforge_20201107~dfsg-3.dsc
 abc957a887a5020352cd9259426025bafff5a275 50196 fontforge_20201107~dfsg-3.debian.tar.xz
 f6ad8c13237612a826c3e5b7916580341e845a6e 19350 fontforge_20201107~dfsg-3_amd64.buildinfo
Checksums-Sha256:
 83ac0ffa1639ba7232303a676ba438c8cb4064ed88fe47e42075025033238d88 2992 fontforge_20201107~dfsg-3.dsc
 cc66ece900ba6f162e7f64cbadf1ddd122b2222da425f0087f258ef6060e1d14 50196 fontforge_20201107~dfsg-3.debian.tar.xz
 93873488dfb382d24ebe1d6dd1fa69720ddeff795d4913e7899c8cf46c4c4ced 19350 fontforge_20201107~dfsg-3_amd64.buildinfo
Files:
 99d2db63258c343490d0c8418417eb61 2992 fonts optional fontforge_20201107~dfsg-3.dsc
 226947eb3038ad463d695a9e2770f8a5 50196 fonts optional fontforge_20201107~dfsg-3.debian.tar.xz
 4c38443f46d59e01d36f98024fd16fd7 19350 fonts optional fontforge_20201107~dfsg-3_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEEFCQhsZrUqVmW+VBy6iUAtBLFms8FAmABSvsQHGZva2FAZGVi
aWFuLm9yZwAKCRDqJQC0EsWaz6q4D/9NfIuH6P8r6y487cNQe8Bg2nlud8hHIsXs
Uu3Iun6+EJX/eXvxPe9Et2y+RIZpkLKdDv9eiOlrtbtnNqesVn2KMeuoogosB65n
6kLew+9FEyGc3+mVrPq1gZg+gc0FlrtzBWttCin0P+BcqqwqgRcD4J6BuOwoPNx4
716hyzxqlwV8xE+5hQRs6NLbIN4QKK3jHpxy3qa+rZc4jciDlPBq1DopV9Cf92t5
g4NULZ2YXJf2hrTyCDacaXE3YCL3tvGSAI2HyLQzm36gbFbxmtIQdwmb08NPEPOT
H/4vU5LltignHsOCs7h7Egz8dXRpWoJ3SQ0qDREMwoEMRVOESPG8qUsQOZM45eE0
Rf/E4bu5U3jYCRuiIM7a0kvsLErvCf9KRQXI4yeK/LuT2ZVIQi3RJqY6eGg2MFgO
84ewog6NkMIelVxFzd4OQ3hois0AUBIcpAVzPhNFVVu56V4sTfmJS1U54GdN2bBM
OoNUHjgS7bmACg5hWbz07PRuoLbaoMlc9zMmTJ89N3cAttWyamNPIQkj98J2yhKo
kFuULyOTSyPM+yvlPzaV/3cs0O/yluMXQxjv74/3QZfxwPjzjo+p9TsHusINXIq/
FLvLsB7XbMCj0X+pZBnVjyAXNByQ83tJ0g5HgA9vGinTcCLGTxqmMT/sVvOOuK0N
HJct3ZLVDw==
=chki
-----END PGP SIGNATURE-----