diff options
author | Chris Lamb <lamby@debian.org> | 2017-08-17 09:48:54 -0700 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-08-20 23:22:27 +0200 |
commit | 601ed84320357be594c68737288d656872b8739e (patch) | |
tree | f13f17c0cc44e19aa5835576884b192705a455be | |
parent | cd0108664d3b7846b20de01aff5cdf1d0f326cd2 (diff) | |
download | gcab-601ed84320357be594c68737288d656872b8739e.tar.gz |
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
timezone.
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>
https://bugzilla.gnome.org/show_bug.cgi?id=786435
-rw-r--r-- | 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); |