Debian Bug report logs -
#239424
realpath(3) out of date
Reported by: Thomas Hood <jdthood@yahoo.co.uk>
Date: Mon, 22 Mar 2004 17:18:02 UTC
Severity: normal
Found in version 1.66-1
Fixed in version manpages/2.04-1
Done: Martin Schulze <joey@infodrom.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#239424; Package manpages-dev.
(full text, mbox, link).
Acknowledgement sent to Thomas Hood <jdthood@yahoo.co.uk>:
New Bug report received and forwarded. Copy sent to Martin Schulze <joey@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: manpages-dev
Version: 1.66-1
Severity: normal
The realpath(3) man page is out of date. The description fails to note
that resolvedpath can be NULL. In this case the result is stored in a
malloc'd buffer whose address is returned.
The BUGS section of the man page begins with "Never use this function."
This advice and the explanation that follows it is also out of date.
With resolvedpath=NULL the caller need not allocate a buffer before
calling realpath().
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (800, 'testing'), (700, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.4.24
Locale: LANG=en_IE@euro, LC_CTYPE=en_IE@euro
Versions of packages manpages-dev depends on:
ii manpages 1.66-1 Manual pages about using a GNU/Lin
-- no debconf information
Information forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#239424; Package manpages-dev.
(full text, mbox, link).
Acknowledgement sent to "Michael Kerrisk" <mtk-manpages@gmx.net>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <joey@debian.org>.
(full text, mbox, link).
Message #10 received at 239424@bugs.debian.org (full text, mbox, reply):
Hi Martin,
I spotted this report and realized that I already independently
added some of the information that Thomas Hood is talking about
in man-pages-2.00 (Dec 2004). I've just now amended that text
slightly to be more accurate.
I think Thomas probably thinks that setting seolved_path to
NULL means that realpath() will allocate a buffer that is always
large enough. This is not the case: it only allocates up to
PATH_MAX bytes.
The current text (as it will appear in man-pages-2.04) is:
NOTES
The glibc implementation of realpath() provides a non-
standard extension. If resolved_path is specified as
NULL, then realpath() uses malloc(3) to allocate a buffer
of up to PATH_MAX bytes to hold the resolved pathname, and
returns a pointer to this buffer. The caller should deal-
locate this buffer using free(3).
BUGS
Avoid using this function. It is broken by design since
(unless using the non-standard resolved_path == NULL fea-
ture) it is impossible to determine a suitable size for
the output buffer, resolved_path. According to POSIX a
buffer of size PATH_MAX suffices, but PATH_MAX need not be
a defined constant, and may have to be obtained using
pathconf(). And asking pathconf() does not really help,
since on the one hand POSIX warns that the result of path-
conf() may be huge and unsuitable for mallocing memory.
And on the other hand pathconf() may return -1 to signify
that PATH_MAX is not bounded.
Please close this report.
Cheers,
Michael
--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7
Want to help with man page maintenance? Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.
Please submit non-trivial man page suggestions as
"diff -u" patches.
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
Information forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#239424; Package manpages-dev.
(full text, mbox, link).
Acknowledgement sent to "Michael Kerrisk" <mtk-manpages@gmx.net>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <joey@debian.org>.
(full text, mbox, link).
Message #15 received at 239424@bugs.debian.org (full text, mbox, reply):
tags 239424 pending
thanks
--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7
Want to help with man page maintenance? Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
Tags added: pending
Request was from "Michael Kerrisk" <mtk-manpages@gmx.net>
to control@bugs.debian.org.
(full text, mbox, link).
Reply sent to Martin Schulze <joey@infodrom.org>:
You have taken responsibility.
(full text, mbox, link).
Notification sent to Thomas Hood <jdthood@yahoo.co.uk>:
Bug acknowledged by developer.
(full text, mbox, link).
Message #22 received at 239424-close@bugs.debian.org (full text, mbox, reply):
Source: manpages
Source-Version: 2.04-1
We believe that the bug you reported is fixed in the latest version of
manpages, which is due to be installed in the Debian FTP archive:
manpages-dev_2.04-1_all.deb
to pool/main/m/manpages/manpages-dev_2.04-1_all.deb
manpages_2.04-1.diff.gz
to pool/main/m/manpages/manpages_2.04-1.diff.gz
manpages_2.04-1.dsc
to pool/main/m/manpages/manpages_2.04-1.dsc
manpages_2.04-1_all.deb
to pool/main/m/manpages/manpages_2.04-1_all.deb
manpages_2.04.orig.tar.gz
to pool/main/m/manpages/manpages_2.04.orig.tar.gz
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 239424@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Martin Schulze <joey@infodrom.org> (supplier of updated manpages 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@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Sun, 13 Nov 2005 06:55:01 +0100
Source: manpages
Binary: manpages manpages-dev
Architecture: source all
Version: 2.04-1
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <joey@debian.org>
Changed-By: Martin Schulze <joey@infodrom.org>
Description:
manpages - Manual pages about using a GNU/Linux system
manpages-dev - Manual pages about using GNU/Linux for development
Closes: 194842 239424 263109 290880 296183 308359 309578 311680 311800 313607
Changes:
manpages (2.04-1) unstable; urgency=low
.
* New upstream version
- Includes updates nice(5) page (Closes: Bug#296183)
- Fix description of return value in getopt(3) (Closes: Bug#308359)
- Corrected example in hsearch(3) (Closes: Bug#313607)
- Added reference to log1p(3) (Closes: Bug#309578)
- Fix return value for makecontext(3) (Closes: Bug#311800)
- Fix example in rand(3) (Closes: Bug#194842)
- Corrections to realpath(3) (Closes: Bug#239424)
- Corrected header in rcmd(3) (Closes: Bug#311680)
- Corrected %p type in scanf(3) (Closes: Bug#263109)
- Corrected info for standard filedes in stdin(3) (Close: Bug#295859)
- Added missing header to strerror(3) (Closes: Bug#290880)
Files:
cb010283c01f88d5984f94ff6fdce46a 584 doc - manpages_2.04-1.dsc
86619809c53b5d8c6c6c82cb0aa8c4c8 1029542 doc - manpages_2.04.orig.tar.gz
e31dc334b17d1b981142855dbd46a1a1 45665 doc - manpages_2.04-1.diff.gz
633a73a4097ca44b14a12b79fa1f0207 398780 doc important manpages_2.04-1_all.deb
988ac1a7816ccf2b4ed04b0642930179 1089660 doc standard manpages-dev_2.04-1_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDdtYhW5ql+IAeqTIRAqOrAJ0ZJ537W1mAr/f1IGzGJHL/gvtuugCgjBr3
nVUGOdt9aYxS7SLpUjZB0ig=
=vNLk
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sun, 24 Jun 2007 22:20:20 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Thu Mar 9 10:03:58 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.