Bug 11356 - find error messages are garbled in findutils-4.1.4-1
find error messages are garbled in findutils-4.1.4-1
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: findutils (Show other bugs)
1.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Preston Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-05-11 02:57 EDT by Jonathan Kamens
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-11 02:57:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2000-05-11 02:57:53 EDT
This bit of code appears in findutils-4.1.4/lib/error.c:

      char errbuf[1024];
      /* Don't use __strerror_r's return value because on some systems
	 (at least DEC UNIX 4.0[A-D]) strerror_r returns `int'.  */
      __strerror_r (errnum, errbuf, sizeof errbuf);
      fprintf (stderr, ": %s", errbuf);

The problem is, this is wrong on Linux.  __strerror_r on Linux returns
EITHER a pointer to a constant string OR errbuf, if it was necessary to use
errbuf to generate the error string.  This results in find printing garbage
whenever it wants to print an error.  The ChangeLog for findutils claims
that error.c was copied from fileutils, so this bug is probably in
fileutils too.  I changed it as follows to get rid of the garbage errors:

      char errbuf[1024];
      /* Don't use __strerror_r's return value on most platforms
	 because on some systems (at least DEC UNIX 4.0[A-D])
	 strerror_r returns `int'.  */
#ifdef __GLIBC__
      fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof
errbuf));
#else
      __strerror_r (errnum, errbuf, sizeof errbuf);
      fprintf (stderr, ": %s", errbuf);
#endif /* __GLIBC__ */
Comment 1 Preston Brown 2000-11-28 15:22:19 EST
we shipped 4.1.5 in 7.0 final.

Note You need to log in before you can comment on or make changes to this bug.