public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "asb@bu.edu" <sourceware-bugzilla@sources.redhat.com>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/578] New: zic fails when symlinks are used and directory is not empty
Date: Thu, 25 Nov 2004 19:53:00 -0000	[thread overview]
Message-ID: <20041125195324.578.asb@bu.edu> (raw)

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.


             reply	other threads:[~2004-11-25 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-25 19:53 asb@bu.edu [this message]
2005-09-26 16:23 ` [Bug libc/578] " drepper at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041125195324.578.asb@bu.edu \
    --to=sourceware-bugzilla@sources.redhat.com \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).