Bug 15838 - fts.h interfaces are presently non-usable except on 64-bit systems
Summary: fts.h interfaces are presently non-usable except on 64-bit systems
Status: RESOLVED DUPLICATE of bug 11460
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 19:32 UTC by Rich Felker
Modified: 2024-02-06 19:15 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Felker 2013-08-14 19:32:00 UTC
fts.h contains the following:

/* The fts interface is incompatible with the LFS interface which
   transparently uses the 64-bit file access functions.  */
#ifdef __USE_FILE_OFFSET64
# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
#endif

Thus, the whole fts.h API is useless except on 64-bit machines. Assuming a 32-bit system, if 64-bit off_t is used, fts.h explicitly generates an error. If 32-bit off_t is used, fts will fail at runtime because stat fails with EOVERFLOW when the inode number or file size does not fit in 32 bits, making any program using the fts interfaces unreliable.

I would prefer just deprecating this whole API, removing the header and using symbol versioning to prevent new apps from linking to it. There is a perfectly good version, without the 32-bit limitations, in gnulib which apps can use if they need it, and there are various BSD versions that also work fine. The breakage in the glibc version is purely from keeping ABI compatibility with the old 32-bit off_t interfaces.

Alternatively, FTS64, fts_open64, etc. could be added...
Comment 1 Joseph Myers 2015-08-24 09:45:54 UTC
Duplicate.

*** This bug has been marked as a duplicate of bug 11460 ***