On Sun, Aug 16, 2015 at 10:53:55AM +0100, Chris Lamb wrote:
> Source: libcdio
> Version: 0.83-4.2
> Severity: serious
> Justification: fails to build from source
> 
> Dear Maintainer,
> 
> libcdio fails to build from source on unstable/amd64 under some
> timezones (eg. TZ="/usr/share/zoneinfo/Etc/GMT-14"):
> 
>   [..]
>   /usr/bin/make  check-TESTS
[...]
>   FAIL: testiso9660
[...]

I have looked into this and there appear to be two problems. One is that
the ISO9660 format, as far as I can see, still has no support for the
GMT-14 time zone. It was introduced in 1995 and the limits in ISO9660
have not yet adapted, being restricted to GMT+12 and GMT-13. There
probably needs to be special handling for GMT-14 to ignore test failure
there as it seems inevitable.

The other is that I *think* there are sign errors in the upstream time
zone handling and therefore more time zones fail than should.

| $ TZ=GMT+13 test/testiso9660 
| ++ WARN: string 'ABC!123' is getting truncated to 2 characters
| ++ WARN: Converted ISO 9660 timezone -52 is less than -48. Adjusted
| $ TZ=GMT-13 test/testiso9660 
| ++ WARN: string 'ABC!123' is getting truncated to 2 characters
| ++ WARN: Converted ISO 9660 timezone -52 is less than -48. Adjusted
| GMT offsets aren't equal. get: 46800, set 43200
| local time retrieved with iso9660_get_ltime() not
| same as that set with iso9660_set_ltime().

As you can see both offsets get the westward 12 hour limit applied,
probably in different functions using different signs.  There are
multiple time functions in lib/iso9660/iso9660.c and there is code like

| #ifdef HAVE_TM_GMTOFF
|     /* Convert seconds to minutes */
|     timezone = p_tm->tm_gmtoff / 60;
| #else
|     timezone = (p_tm->tm_isdst > 0) ? -60 : 0;
| #endif

tm_gmtoff is seconds east of UTC and thus the offset to add. DST is also
a positive offset but is given as a negative. The dtime function uses
the sign of the passed timezone, the ltime function inverts it. Both
limit the time zone value to -48 and 52. I'm not familiar with the
intricacies of ISO9660 time values, but this needs a good looking over I
think.

Reply via email to