[gcab] libgcab/gcab-file.c: Don't encode timezone in generated files.

commit 601ed84320357be594c68737288d656872b8739e
Author: Chris Lamb <lamby debian org>
Date:   Thu Aug 17 09:48:54 2017 -0700

    libgcab/gcab-file.c: Don't encode timezone in generated files.
    Whilst working on the Reproducible Builds effort [0], we noticed
    that gcab generates .cab files that are not reproducible. This
    affects packages such as fwupd.
    This is because the embedded dates are encoded with the current
    localtime is expressed relative to the user's specified timezone,
    whilst gmtime is in UTC. This is important so that users building the
    exact same contents in different timezones will end up with the same
    exact .cab file.
      [0] https://reproducible-builds.org/
    Signed-off-by: Chris Lamb <lamby debian org>

 libgcab/gcab-file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index c650b36..e616678 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -136,7 +136,7 @@ gcab_file_update_info (GCabFile *self, GFileInfo *info)
     g_file_info_get_modification_time (info, &tv);
     time = tv.tv_sec;
-    m = localtime (&time);
+    m = gmtime (&time);
     self->cfile.name = self->name;
     self->cfile.usize = g_file_info_get_size (info);

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