diff --git a/timezone.changes b/timezone.changes index 261ef9a..09d6633 100644 --- a/timezone.changes +++ b/timezone.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Oct 14 13:56:20 UTC 2013 - werner@suse.de + +- Add patch tzcode-fromname.patch to correct path expansion for + local time link (bnc#845530) +- Modify tzcode-link.diff to fit with tzcode-fromname.patch +- Modify tzcode-symlink.patch to fit with tzcode-fromname.patch + and to avoid broken posixrules if /etc/localtime is a symlink + ------------------------------------------------------------------- Wed Oct 2 23:35:00 UTC 2013 - lchiquitto@suse.com diff --git a/timezone.spec b/timezone.spec index 1ef2ce5..043109f 100644 --- a/timezone.spec +++ b/timezone.spec @@ -29,6 +29,8 @@ Source: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz Source1: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz Patch0: tzdata-china.diff Patch1: tzcode-zic.diff +# PATCH-FIX-OPENSUSE bnc#845530 +Patch2: tzcode-fromname.patch Patch3: iso3166-uk.diff Patch4: tzcode-link.diff Patch5: tzcode-symlink.patch @@ -48,12 +50,14 @@ can select an appropriate time zone for your system with YaST. # COMMON-PREP-BEGIN %patch0 -p1 %patch1 -p1 +%patch2 -p1 %patch3 -p1 %if 0%{?suse_version} < 1220 %patch4 -p1 %else %patch5 -p1 %endif +sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END %build @@ -63,7 +67,7 @@ LC_ALL=POSIX AREA=%{AREA} ZONE=%{ZONE} export AREA LANG LC_ALL ZONE -make %{?_smp_mflags} TZDIR=%{_prefix}/share/zoneinfo CFLAGS="$RPM_OPT_FLAGS -DHAVE_GETTEXT=1 -DTZDEFAULT='\"/etc/localtime\"' -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone" AWK=awk +make %{?_smp_mflags} TZDIR=%{_datadir}/zoneinfo CFLAGS="$RPM_OPT_FLAGS -DHAVE_GETTEXT=1 -DTZDEFAULT='\"/etc/localtime\"' -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone" AWK=awk make %{?_smp_mflags} TZDIR=zoneinfo AWK=awk zones # Generate posixrules ./zic -y ./yearistype -d zoneinfo -p %{AREA}/%{ZONE} diff --git a/tzcode-fromname.patch b/tzcode-fromname.patch new file mode 100644 index 0000000..55476f9 --- /dev/null +++ b/tzcode-fromname.patch @@ -0,0 +1,24 @@ +--- timezone-2013g/zic.c ++++ timezone-2013g/zic.c 2013-10-14 13:52:42.070235810 +0000 +@@ -628,17 +628,17 @@ dolink(const char *const fromfield, cons + + result = link(fromname, toname); + if (result != 0) { +- const char *s = fromfield; ++ const char *s = fromname; + const char *t; + register char * symlinkcontents = NULL; + + do + t = s; + while ((s = strchr(s, '/')) +- && ! strncmp (fromfield, tofield, +- ++s - fromfield)); ++ && ! strncmp (fromname, tofield, ++ ++s - fromname)); + +- for (s = tofield + (t - fromfield); ++ for (s = tofield + (t - fromname); + (s = strchr(s, '/')); + s++) + symlinkcontents = diff --git a/tzcode-link.diff b/tzcode-link.diff index d15314b..8cd6876 100644 --- a/tzcode-link.diff +++ b/tzcode-link.diff @@ -33,5 +33,5 @@ Index: timezone-2013g/zic.c + if (result != 0) + result = copy(fromname, toname); if (result != 0) { - const char *s = fromfield; + const char *s = fromname; const char *t; diff --git a/tzcode-symlink.patch b/tzcode-symlink.patch index 6e04bfa..59b197c 100644 --- a/tzcode-symlink.patch +++ b/tzcode-symlink.patch @@ -1,5 +1,5 @@ ---- timezone-2013g.orig/zic.c -+++ timezone-2013g/zic.c +--- timezone-2013g/zic.c ++++ timezone-2013g/zic.c 2013-10-14 14:23:08.450235811 +0000 @@ -120,7 +120,7 @@ static int addtype(zic_t gmtoff, const c static void leapadd(zic_t t, int positive, int rolling, int count); static void adjleap(void); @@ -18,7 +18,7 @@ if (noise) for (j = 0; j < nlinks; ++j) if (strcmp(links[i].l_to, -@@ -584,17 +584,17 @@ _("%s: More than one -L option specified +@@ -584,18 +584,19 @@ _("%s: More than one -L option specified } if (lcltime != NULL) { eat("command line", 1); @@ -37,9 +37,22 @@ -dolink(const char *const fromfield, const char *const tofield) +dolink(const char *const fromfield, const char *const tofield, int defaultsymlink) { ++ struct stat st; register char * fromname; register char * toname; -@@ -619,15 +619,16 @@ dolink(const char *const fromfield, cons + +@@ -606,6 +607,10 @@ dolink(const char *const fromfield, cons + fromname = ecatalloc(fromname, "/"); + fromname = ecatalloc(fromname, fromfield); + } ++ ++ if (lstat(fromname, &st) == 0 && S_ISLNK(st.st_mode)) ++ defaultsymlink = TRUE; ++ + if (tofield[0] == '/') + toname = ecpyalloc(tofield); + else { +@@ -619,15 +624,16 @@ dolink(const char *const fromfield, cons */ if (!itsdir(toname)) (void) remove(toname); @@ -56,6 +69,6 @@ + if (!defaultsymlink) result = link(fromname, toname); + + if ((defaultsymlink || (!defaultsymlink && result != 0))) { - const char *s = fromfield; + const char *s = fromname; const char *t; register char * symlinkcontents = NULL;