Bug 18235 - utmpx struct's ut_tv member has wrong type on x86_64 linux
Summary: utmpx struct's ut_tv member has wrong type on x86_64 linux
Status: RESOLVED WONTFIX
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-10 10:19 UTC by Szabolcs Nagy
Modified: 2015-04-20 08:56 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szabolcs Nagy 2015-04-10 10:19:09 UTC
ut_tv member is required to have type struct timeval

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/utmpx.h.html

the following code fails on x86_64 linux:

#define _XOPEN_SOURCE 700
#include <utmpx.h>
void f()
{
struct utmpx x;
struct timeval *p = &x.ut_tv; // warning: initialization from incompatible pointer type [enabled by default]
}
Comment 1 Florian Weimer 2015-04-20 08:56:32 UTC
We cannot fix this because for bi-arch systems, we want compatibility with the 32-bit utmpx struct layout, per this comment:

/* The fields ut_session and ut_tv must be the same size when compiled
   32- and 64-bit.  This allows files and shared memory to be shared
   between 32- and 64-bit applications.  */