This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/578] New: zic fails when symlinks are used and directory is not empty
- From: "asb at bu dot edu" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 25 Nov 2004 19:53:26 -0000
- Subject: [Bug libc/578] New: zic fails when symlinks are used and directory is not empty
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
In timezone/zic.c, around line 630, if link() fails to create a hard link, a
symlink is created. The target of the symlink is found by the following snippet:
const char *s = tofile;
register char * symlinkcontents = NULL;
while ((s = strchr(s+1, '/')) != NULL)
symlinkcontents = ecatalloc(symlinkcontents, ".\./");
symlinkcontents = ecatalloc(symlinkcontents, fromname);
The last line should be:
symlinkcontents = ecatalloc(symlinkcontents, fromfile);
-----------------------------
If the following conditions are met
- directory is set to "/var/tmp/glibc-build-directory", and
- symlinks are not possible
then dolink("America/Argentina/Cordoba","America/Cordoba") will produce a
symlink at /var/tmp/glibc-build-directory/America/Cordoba pointing to
..//var/tmp/glibc-build-directory/America/Argentina/Cordoba.
Clearly, the link is being created in the correct place, but the target should
be "../America/Argentina/Cordoba".
-----------------------------
This bug affects only users that can not create hard links.
-----------------------------
This bug produces the following build error durring make install on my system
(gentoo):
/var/tmp/portage/glibc-2.3.4.20040808-r1/work/build/timezone/zic: Can't link fro
m /var/tmp/portage/glibc-2.3.4.20040808-r1/image//usr/share/zoneinfo/America/Cor
doba to /var/tmp/portage/glibc-2.3.4.20040808-r1/image//usr/share/zoneinfo/Ameri
ca/Rosario: No such file or directory
because America/Cordoba exists, but is a dead link.
# file
/var/tmp/portage/glibc-2.3.4.20040808-r1/image//usr/share/zoneinfo/America/Cordoba
/var/tmp/portage/glibc-2.3.4.20040808-r1/image//usr/share/zoneinfo/America/Cordoba:
broken symbolic link to
`..//var/tmp/portage/glibc-2.3.4.20040808-r1/image//usr/share/zoneinfo/America/Argentina/Cordoba'
--
Summary: zic fails when symlinks are used and directory is not
empty
Product: glibc
Version: 2.3.3
Status: NEW
Severity: minor
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: asb at bu dot edu
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://sources.redhat.com/bugzilla/show_bug.cgi?id=578
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.