[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#861955: marked as done (canna: please make the output of mkbindic reproducible)



Your message dated Sun, 06 Sep 2020 15:03:51 +0000
with message-id <E1kEwCt-0007Jt-3X@fasolo.debian.org>
and subject line Bug#861955: fixed in canna 3.7p3-16
has caused the Debian Bug report #861955,
regarding canna: please make the output of mkbindic reproducible
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 owner@bugs.debian.org
immediately.)


-- 
861955: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861955
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: canna
Version: 3.7p3-13.1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps toolchain
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that canna's mkbindic utility does not generate reproducible
output.

This affects other packages such as canna-shion, but probably
others.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-
diff --git a/cmd/crxdic/crxdic.c b/cmd/crxdic/crxdic.c
index 36d7a1f..4d76eef 100644
--- a/cmd/crxdic/crxdic.c
+++ b/cmd/crxdic/crxdic.c
@@ -31,6 +31,7 @@ static char rcsid[]="@(#) 102.1 $Id: crxdic.c,v 1.11.2.2 2003/12/27 17:15:21 aid
 #include <time.h>
 #include <ctype.h>
 #include <fcntl.h>
+#include <limits.h>
 #include <assert.h>
 #include "ccompat.h"
 #include "RKindep/file.h"
@@ -932,6 +933,9 @@ makeHeader(dic)
   unsigned		i;
   RkiCksumCalc		calc;
   unsigned		off;
+  char *source_date_epoch;
+  unsigned long long epoch;
+  char *endptr;
     
   if (RkiCksumCRCInit(&calc)
       || RkiCksumAdd(&calc, dic->Dir->buf, dic->Dir->dirsiz)) {
@@ -963,7 +967,32 @@ makeHeader(dic)
     hd.data[HD_CMPV].var = 0x300702L;
     hd.flag[HD_CMPV] = -1;
   }
-  hd.data[HD_TIME].var = tloc = time(0);
+  source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+  if (source_date_epoch) {
+    errno = 0;
+    epoch = strtoull(source_date_epoch, &endptr, 10);
+    if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
+                    || (errno != 0 && epoch == 0)) {
+            fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", strerror(errno));
+            exit(EXIT_FAILURE);
+    }
+    if (endptr == source_date_epoch) {
+            fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", endptr);
+            exit(EXIT_FAILURE);
+    }
+    if (*endptr != '\0') {
+            fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", endptr);
+            exit(EXIT_FAILURE);
+    }
+    if (epoch > ULONG_MAX) {
+            fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to %lu but was found to be: %llu \n", ULONG_MAX, epoch);
+            exit(EXIT_FAILURE);
+    }
+    tloc = epoch;
+  } else {
+    tloc = time(0);
+  }
+  hd.data[HD_TIME].var = tloc;
   hd.flag[HD_TIME] = -1;
   hd.data[HD_DMNM].ptr = (unsigned char *)STrdup(dic->name);
   hd.flag[HD_DMNM] = strlen(dic->name);

--- End Message ---
--- Begin Message ---
Source: canna
Source-Version: 3.7p3-16
Done: Francisco Vilmar Cardoso Ruviaro <francisco.ruviaro@riseup.net>

We believe that the bug you reported is fixed in the latest version of
canna, 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 861955@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Francisco Vilmar Cardoso Ruviaro <francisco.ruviaro@riseup.net> (supplier of updated canna 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 ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 01 Sep 2020 03:14:05 +0000
Source: canna
Architecture: source
Version: 3.7p3-16
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Francisco Vilmar Cardoso Ruviaro <francisco.ruviaro@riseup.net>
Closes: 861955
Changes:
 canna (3.7p3-16) unstable; urgency=medium
 .
   * QA upload.
   * Configured git-buildpackage for Debian.
   * Ran wrap-and-sort -a.
   * debian/canna.lintian-overrides:
       - Removed unused override 'spelling-error-in-binary'.
       - Renamed tag binary-without-manpage to no-manual-page.
   * debian/canna-utils.lintian-overrides: renamed tag binary-without-manpage to
     no-manual-page.
   * debian/control: added 'Pre-Depends: ${misc:Pre-Depends}' as per lintian
     warning.
   * debian/libcanna1g.symbols: added 'Build-Depends-Package' field.
   * debian/patches:
       - 05_hppabuild.patch: removed patch applied by upstream.
       - 06_fix_spelling_error.patch renamed to 05_fix_spelling_error.patch.
       - 07_fix_manpages_error.patch renamed to 06_fix_manpages_error.patch.
       - 08_fix_ftbfs_on_hurd-i386.patch renamed to
         07_fix_ftbfs_on_hurd-i386.patch.
       - 09_fix_format_security.patch renamed to 08_fix_format_security.patch.
       - 10_fix_manpages_error.patch renamed to 09_fix_manpages_error.patch.
       - 11_fix_configure.ac.patch renamed to 10_fix_configure.ac.patch.
       - 11_fix_spelling_error_in_binary.patch: added.
       - 12_make_the_output_of_mkbindic_reproducible.patch: added.
         Thanks to Chris Lamb <lamby@debian.org>. (Closes: #861955)
   * debian/po/pt_BR.po: converted from ISO-8859-1 to UTF-8.
   * debian/rules:
       - Removed 'override_dh_auto_clean'.
       - Removed trailing whitespaces.
Checksums-Sha1:
 d2bfbcd833eb5468a4f2655052a337e321c09939 2082 canna_3.7p3-16.dsc
 ccb77dc665caa9b9fdf5ef39d596ccfc9dd925a8 52788 canna_3.7p3-16.debian.tar.xz
 b31bf2fcd8e0abbc5f227890256242981d92f029 9591 canna_3.7p3-16_amd64.buildinfo
Checksums-Sha256:
 98866363f3a775b656eb381413fd5ee38671205a6a1f69e7f17dc0f9f66b652f 2082 canna_3.7p3-16.dsc
 d45a6ec02e5d0122eaedb42fb2e57b81891dbb03f23e91661852bcbbd25d73f6 52788 canna_3.7p3-16.debian.tar.xz
 fe76face9e7814f01eb6b2e99e10aaaa4c3d7f36ab239a342e3af262e8ad86a4 9591 canna_3.7p3-16_amd64.buildinfo
Files:
 0c0c3193abc3a894d105b47c7e22773f 2082 utils optional canna_3.7p3-16.dsc
 3b9acb0f8888fa9e72354b02ebb01b91 52788 utils optional canna_3.7p3-16.debian.tar.xz
 e6a523e3f57faa346bf0c824915ac643 9591 utils optional canna_3.7p3-16_amd64.buildinfo

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

iQIzBAEBCgAdFiEEBdtqg34QX0sdAsVfu6n6rcz7RwcFAl9U9p4ACgkQu6n6rcz7
Rwd5wQ//QoQD9pvQd4dCzPaqpZDYjARIEkhPEBVNDYTAMVtc38mX7sbKT5oqkhN+
8X4mam/xiJ4X0khuJ5XiVGxNndHF92L1mJRiRCYRwFSRAXCXJHM3yglelb6cxD5L
mjh5s+9BI25C3BObMb6osRSZR60EBVXULWQewzU3nL6RzQ7nzT6klah7q8NV01Kr
LFJVjcQLyQLKNmI/KwR2baMWsgBdN6hbVsZtkmH4Pb84Nt/hs2ySNUn/LX12PsUM
x51J7GmDWnzPSzqSp+8tk3WRyA1hz2O6+/y239lActNRsHlpNJpG/Kj5H2NxLqYI
KUtCCkzg6wdWR+SiUwJfC73oRehl1XR3tSi30MtYbzn6Z0pSSmUHNnoBB11w0zK/
DAweSPM62Hvvw85DFGQBa6TcJC5kceh1kFAW0Q2rC/iT2unXPnABDVzaPSvWOzdn
TWZ+AlwxJibUSEBDH+rYw8/NtYVM9RsQ4FDzYjV3Zyr8furEjhfkcqK6aqJpTKpN
Woijg2V6w7e/F5KpzsIjy4Ct4DFhWA0Ryn9iqomTVhx4JVJq38I1NNugq0quvTdU
R/TYwepBpZLm9oP6oD80gxwgoC+q9iV5AdaPbLa1txPdsOoDm6tdzat0isVCOPYY
cbGmHb2QOrlcg0wUo02Boj23NQZUWO1qTifrqLFJVmMoY5nWJII=
=3mgx
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: