zic symbolic-link bug
Paul Eggert
eggert at CS.UCLA.EDU
Tue Mar 13 23:13:40 UTC 2007
In <http://sources.redhat.com/ml/libc-alpha/2005-11/msg00127.html>
Phil Estes suggested this patch:
===================================================================
RCS file: RCS/zic.c,v
retrieving revision 2007.3
diff -pu -r2007.3 zic.c
--- zic.c 2007/02/26 14:09:16 2007.3
+++ zic.c 2007/03/07 17:38:11
@@ -675,7 +675,7 @@ const char * const tofile;
"../");
symlinkcontents =
ecatalloc(symlinkcontents,
- fromname);
+ fromfile);
result = symlink(symlinkcontents,
toname);
if (result == 0)
which looks like a good idea to me.
To be honest, I don't fully understand the ramifications of this
patch, but it does appear to me that some sort of patch is needed in
this area, as the existing code appends "../" and then never uses the
result. I don't see any bug in the proposed patch, at any rate.
Relative and absolute symlinks both have their advantages, so perhaps
there should be an option? But personally I'd think relative should
be the default, and the above-quoted patch is the simplest way to do
that.
More information about the tz
mailing list