Package: libc6-dev
Version: 2.3.2.ds1-11
Severity: minor
The description of realpath() in /usr/include/stdlib.h begins this way:
/* Return the canonical absolute name of file NAME.
It then continues:
The last file name component need not exist, and may be a symlink
to a nonexistent file.
This is not true. The function returns the null string if the last
file name component fails to exist. Here's proof.
[EMAIL PROTECTED]:/tmp$ cat s.c
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
main(int argc, char ** argv)
{
char f[] = "/tmp/foo";
char buf[PATH_MAX];
printf("%s %s\n", f, realpath(f,buf));
}
[EMAIL PROTECTED]:/tmp$ gcc s.c
[EMAIL PROTECTED]:/tmp$ ls -l foo bar
ls: bar: No such file or directory
lrwxrwxrwx 1 jdthood jdthood 3 2004-03-22 18:09 foo -> bar
[EMAIL PROTECTED]:/tmp$ ./a.out
/tmp/foo (null)
[EMAIL PROTECTED]:/tmp$ touch bar
[EMAIL PROTECTED]:/tmp$ ls -l foo bar
-rw-r--r-- 1 jdthood jdthood 0 2004-03-22 18:10 bar
lrwxrwxrwx 1 jdthood jdthood 3 2004-03-22 18:09 foo -> bar
[EMAIL PROTECTED]:/tmp$ ./a.out
/tmp/foo /tmp/bar
The false sentence quoted above should be removed from stdlib.h.
-- 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: [EMAIL PROTECTED], [EMAIL PROTECTED]
Versions of packages libc6-dev depends on:
ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an
ii linux-kernel-headers 2.5.999-test7-bk-15 Linux Kernel Headers for developme
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]