After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706405 - buffer_get_time() should use time_t
buffer_get_time() should use time_t
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: pkcs11
3.8.x
Other OpenBSD
: Normal major
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-08-20 14:52 UTC by Antoine Jacoutot
Modified: 2013-10-10 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make buffer_get_time() use time_t (1.67 KB, patch)
2013-08-20 14:52 UTC, Antoine Jacoutot
committed Details | Review

Description Antoine Jacoutot 2013-08-20 14:52:02 UTC
Created attachment 252434 [details] [review]
make buffer_get_time() use time_t

Hi.

ctime and mtime are time_t values.
However, buffer_get_time() takes glong as its last argument. This is problematic because depending on the operating system and arch, time_t can be different.
For e.g. on OpenBSD it is both long long for 32-bit and 64-bit architectures while on Linux, it is long for 32-bit.

This actually leads to a crash on my i386 machine running OpenBSD.

I believe modifying buffer_get_time() to use time_t * as the last argument is the right way to go.

gtk_secret_object_set_created() and gtk_secret_object_get_created() also
take glong as its argument so there may still be some truncation on
32-bit systems -- not sure what to do about these.

Opinion?
Comment 1 Antoine Jacoutot 2013-08-27 08:50:01 UTC
Any comment? It would be nice to have this fixed for 3.10 for OpenBSD users (I know it's a long shot but well...).
Thanks.
Comment 2 Antoine Jacoutot 2013-10-10 14:54:38 UTC
Hi.

I would appreciate if someone could have a look... thank you.
Comment 3 Stef Walter 2013-10-10 15:20:55 UTC
Thanks. Committed the patch.

(In reply to comment #0)
> gtk_secret_object_set_created() and gtk_secret_object_get_created() also
> take glong as its argument so there may still be some truncation on
> 32-bit systems -- not sure what to do about these.

Seems like they should use time_t as well, right? Could you either reopen this bug or file a new one, when you have patch.