[Rpm-maint] [rpm-software-management/rpm] Take changelog timezone in account (RhBug 1715412) (#739)

Panu Matilainen notifications at github.com
Mon Jun 24 10:39:51 UTC 2019


pmatilai commented on this pull request.



> @@ -178,13 +179,17 @@ static int dateToTimet(const char * datestr, time_t * secs, int * date_words)
 
     if (*secs == -1) goto exit;
 
+    if (tzname[1][0] == 0)
+	rpmlog(RPMLOG_WARNING, _("time zone in %%changelog not in tz database: %s\n"), datestr);

But it's not like *you're* consulting a timezone database here. What tzname contains is up to the libc implementation, https://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html or https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08 say nothing at all about any databases, much less that tzname[1] contains a value from the tz database.

 In fact, tzname[1] is dst, of which the standard says:
> std and dst
    Indicate no less than three, nor more than {TZNAME_MAX}, bytes that are the designation for the standard (std) or the alternative (dst -such as Daylight Savings Time) timezone. Only std is required; if dst is missing, then the alternative time does not apply in this locale. 

This is far from my area of expertise but based on the above, I don't see how you can determine the validity from tzname[1].
Further, tzname is a string so for an empty string you should be comparing for character '\0', not 0 the number. It might not make a difference to the computer but these things matter to the reader.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/739#discussion_r296659642
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190624/f94db73c/attachment.html>


More information about the Rpm-maint mailing list