typo in timezone/zic.c update from tzcode2005c

Phil Estes pestes@us.ibm.com
Wed Nov 30 21:03:00 GMT 2005


The zic.c cleanup of the linking fallback code in the dolink() function 
introduces a typo in the fallback option.  If the hardlink fails, it 
builds up paths for the symlink which are not complete.  Basically, the 
code uses fromfile instead of fromname when building the target of the 
symlink.  This creates a dangling symlink.  For example, if 
TZDIR/directory = "/usr/share/zoneinfo" and the toname = /etc/localtime, 
then the symlink created for localtime with this code would point to 
../America/New_York since "America/New_York" is the fromfile, whereas it 
should have used fromname (directory+fromfile) to create a symlink to 
../usr/share/zoneinfo/America/New_York

The attached patch resolves this typo and fixes the problem.  The source 
of the issue can be seen in a diff from zic.c 1.17 to 1.18 in glibc cvs, 
noted as the update to tzcode2005c.  Since this appears to be a direct 
result of updating to that code, maybe there is something I am missing; 
but from what I understand, using `zic -l America/New_York` should 
create a proper symlink at /etc/localtime if hardlinking fails (such as 
/etc and /usr being on different physical media).  In my case this 
produces a dangling symlink.

Thanks,
Phil Estes
pestes@us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-zic-fix.patch
Type: text/x-patch
Size: 409 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20051130/dc5d7cc2/attachment.bin>


More information about the Libc-alpha mailing list