Bug 94497 - Logout times in history are wrong if user shutdowns directly from user session
Summary: Logout times in history are wrong if user shutdowns directly from user session
Status: RESOLVED FIXED
Alias: None
Product: accountsservice
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Matthias Clasen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-11 15:08 UTC by Ondrej Holy
Modified: 2016-07-02 12:57 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
wtmp: Fix logout times in login-history (1.93 KB, patch)
2016-06-28 11:14 UTC, Ondrej Holy
Details | Splinter Review
users panel screenshots (92.47 KB, image/png)
2016-06-28 11:17 UTC, Ondrej Holy
Details

Description Ondrej Holy 2016-03-11 15:08:13 UTC
Logout times for users are correct if user logs off and then shutdown from gdm, however logout times are wrong if user shutdowns directly from the user session, because boot time is used in this case.

wtmp contains also shutdown records. Logout time should be set to the time from shutdown record instead.

One can list those records using "last -x", it looks like as following:
shutdown system down  4.4.3-300.fc23.x Mon Mar  7 08:13 - 08:14  (00:00)

See last source codes:
util-linux/login-utils/last.c

See original g-c-c report:
https://bugzilla.gnome.org/show_bug.cgi?id=762346
Comment 1 Ondrej Holy 2016-06-28 11:14:18 UTC
Created attachment 124758 [details] [review]
wtmp: Fix logout times in login-history

Set logout time to the time from shutdown/reboot records instead of time from BOOT_TIME record.
Comment 2 Ondrej Holy 2016-06-28 11:17:44 UTC
Created attachment 124759 [details]
users panel screenshots
Comment 3 Ray Strode [halfline] 2016-06-28 12:16:53 UTC
k


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.