Your message dated Tue, 30 Apr 2024 11:54:36 +0000
with message-id <[email protected]>
and subject line Bug#1070056: fixed in oath-toolkit 2.6.11-3
has caused the Debian Bug report #1070056,
regarding oath-toolkit FTBFS on 32-bit big-endian hppa platform
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1070056: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070056
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: oath-toolkit
Version: 2.6.11
Tags: ftbfs, patch
X-Debbugs-Cc: [email protected]
User: [email protected]
Usertags: time-t

As can be seen here:
https://buildd.debian.org/status/fetch.php?pkg=oath-toolkit&arch=hppa&ver=2.6.11-2.1&stamp=1713624192&raw=0
oath-toolkit testsuite fails on hppa like this:

FAIL: oathtool --verbose --totp --now @0 00
expected:
Start time: 1970-01-01 00:00:00 UTC (0)
Current time: 1970-01-01 00:00:00 UTC (0)
got:
Start time: 1970-01-01 00:00:00 UTC (2130640639)
Current time: 1970-01-01 00:00:00 UTC (35)

The failure stems from the fact that hppa is a 32-bit big-endian platform,
and which is the reason as well, why it does not fail on 32-bit little endian 
platforms.
(Although this is not an issue on arm, I nevertheless added the usertag since 
this bug in timet related)

The C-code is similar to this:
printf ("Current time: %ld\n", tim);
where tim is of type "time_t".

time_t can be 32- or 64-bit, depending on compile flags.
On Debian we now did for 32-bit platforms the time64 transition, which
made that value become a 64-bit entity.
So, the "%ld" printf format which defines 32-bit values on hppa does not
fit to the 64-bit tim value stored on the stack. Additionally hppa has
alignment requirements for 64-bit values which are put on the stack, which
is why a wrong value is printed in the testcase.

Solution is either to apply the attached patch, or to make printf
use "%ld" for 32-bit time_t and "%lld" for 64-bit time_t, which needs
to be checked at compile-time.
--- oathtool/oathtool.c.org	2024-04-29 11:55:18.854982447 +0000
+++ oathtool/oathtool.c	2024-04-29 11:57:34.646507216 +0000
@@ -96,6 +96,7 @@
 {
   struct tm tmp;
   char outstr[200];
+  long long counter;
 
   printf ("TOTP mode: %s\n", flags == OATH_TOTP_HMAC_SHA256 ? "SHA256" :
 	  flags == OATH_TOTP_HMAC_SHA512 ? "SHA512" :
@@ -107,8 +108,8 @@
   if (strftime (outstr, sizeof (outstr), "%Y-%m-%d %H:%M:%S UTC", &tmp) == 0)
     error (EXIT_FAILURE, 0, "strftime");
 
-  printf ("Step size (seconds): %ld\n", time_step_size);
-  printf ("Start time: %s (%ld)\n", outstr, t0);
+  printf ("Step size (seconds): %lld\n", (long long)time_step_size);
+  printf ("Start time: %s (%lld)\n", outstr, (long long)t0);
 
   if (gmtime_r (&when, &tmp) == NULL)
     error (EXIT_FAILURE, 0, "gmtime_r");
@@ -116,9 +117,9 @@
   if (strftime (outstr, sizeof (outstr), "%Y-%m-%d %H:%M:%S UTC", &tmp) == 0)
     error (EXIT_FAILURE, 0, "strftime");
 
-  printf ("Current time: %s (%ld)\n", outstr, when);
-  printf ("Counter: 0x%lX (%ld)\n\n", (when - t0) / time_step_size,
-	  (when - t0) / time_step_size);
+  printf ("Current time: %s (%lld)\n", outstr, (long long)when);
+  counter = (when - t0) / time_step_size;
+  printf ("Counter: 0x%llX (%lld)\n\n", counter, counter);
 }
 
 #define generate_otp_p(n) ((n) == 1)

--- End Message ---
--- Begin Message ---
Source: oath-toolkit
Source-Version: 2.6.11-3
Done: Simon Josefsson <[email protected]>

We believe that the bug you reported is fixed in the latest version of
oath-toolkit, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Josefsson <[email protected]> (supplier of updated oath-toolkit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 30 Apr 2024 13:13:06 +0200
Source: oath-toolkit
Architecture: source
Version: 2.6.11-3
Distribution: unstable
Urgency: medium
Maintainer: OATH Toolkit Team <[email protected]>
Changed-By: Simon Josefsson <[email protected]>
Closes: 1070056
Changes:
 oath-toolkit (2.6.11-3) unstable; urgency=medium
 .
   [ Helge Deller ]
   * Fix 32-bit big-endian oathtool bug.  Closes: #1070056.
 .
   [ Simon Josefsson ]
   * Add upstream patch for spurious make -j build failures.
   * Add Build-Depends: help2man.
Checksums-Sha1:
 b2463944aa1919beb03b3fede721e0cf16ad6260 2140 oath-toolkit_2.6.11-3.dsc
 842200850688758b853c6f934f4e5fb75a17b2a3 15688 
oath-toolkit_2.6.11-3.debian.tar.xz
 f022eb8c99f41f00d8f983a3c5611cd8169f5070 9748 
oath-toolkit_2.6.11-3_amd64.buildinfo
Checksums-Sha256:
 14935d016c4a3c165cc147267a511827f5f631b633b4461e5d1210ae675530c5 2140 
oath-toolkit_2.6.11-3.dsc
 98bf77dc407bf26af52ad677d32c5ae7f467e9a9b21d8e9336b677b13ef9c115 15688 
oath-toolkit_2.6.11-3.debian.tar.xz
 4a75674146c1f2510f9425fd5e1299f36699845441b6efe1af86493af563b0c7 9748 
oath-toolkit_2.6.11-3_amd64.buildinfo
Files:
 cab0b6cf3add5c3b1b2f459411b4989c 2140 devel optional oath-toolkit_2.6.11-3.dsc
 5cc015111b6e94aca16127b444968a54 15688 devel optional 
oath-toolkit_2.6.11-3.debian.tar.xz
 1e009d4e6464cf72eb443be063ff70e3 9748 devel optional 
oath-toolkit_2.6.11-3_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iIoEARYIADIWIQSjzJyHC50xCrrUzy9RcisI/kdFogUCZjDYWBQcc2ltb25Aam9z
ZWZzc29uLm9yZwAKCRBRcisI/kdFoj+YAP9vQfXBfk7iAkZDXAKyiwfe0I2AIMCg
aobuth8PqtkZJQEAlu/G0nfruuhl45Bouig04w0CyVDjjwbvYzNVZrlIHgk=
=r+mh
-----END PGP SIGNATURE-----

Attachment: pgpIGvuTjwQJp.pgp
Description: PGP signature


--- End Message ---

Reply via email to