tty users logouts not correctly recorded

Bug #1609003 reported by Kev-inc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

1) Release: Ubuntu Gnome 14.04.4 and Xubuntu 14.04.4
2) Version of package: util-linux 2.20.1-5.1ubuntu20.7
3) I would expect that: when a user makes a new login, the number of "users" shown in uptime and w is incremented, and when the user makes a logout that number is decremented.
4) Instead, this does not happen when the login is made through a local tty.

If a user logs in through a ttyx (by pressing from the GUI Ctrl+Alt+Fx), and then logs out, the number of users shown in the outputs of w and uptime still considers him.
This number of users (shown in w and uptime) is in fact always incremented when a new ttyx with a successful login is used; but it is never decremented when that user logs out (unless there is a reboot, obviously).

After a login from just the GUI, the system is:

$ uptime
17:16:09 up 7:05, 1 users, load average: 0,43, 0,50, 0,38

$ who
user :0 2016-08-02 10:21 (:0)

Then I press Ctrl+Alt+F1 and I log in into /dev/tty1. While I'm logged in, it is correctly shown that

$ uptime
17:21:09 up 7:05, 2 users, load average: 0,40, 0,20, 0,31

$ who
user :0 2016-08-02 10:21 (:0)
user tty1 2016-08-02 10:25

Then I log out from tty1. The situation is the following:

$ uptime
17:26:09 up 7:05, 2 users, load average: 0,35, 0,21, 0,32

$ who
user :0 2016-08-02 10:21 (:0)

So the output of who is correct, but uptime still indicates 2 users logged in the system. The same happens with w, which indicates 2 users connected, but then lists just one of them (the only one actually connected!).
The numbers and the times are just an example.
Maybe the getty is not working properly with utmp?
This systematically happened in two different machines, with Ubuntu Gnome 14.04.4 and Xubuntu 14.04.4.
I didn't check the box, but this may be a security vulnerability, because it shows in a wrong way the number of connected users.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: util-linux 2.20.1-5.1ubuntu20.7
ProcVersionSignature: Ubuntu 3.13.0-92.139-generic 3.13.11-ckt39
Uname: Linux 3.13.0-92-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.21
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Aug 2 17:24:49 2016
InstallationDate: Installed on 2014-05-31 (794 days ago)
InstallationMedia: Ubuntu-GNOME 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=it_IT.UTF-8
 SHELL=/bin/bash
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Kev-inc (kev-inc) wrote :
description: updated
Revision history for this message
Phillip Susi (psusi) wrote :

I can confirm this. Note however that it does not just increment every time, but rather seems to still think someone is logged in on that particular tty. That is; if you log out and back in repeatedly on the same tty, it does not increment the logon count, but once you have logged in on a new tty, the count is incremented and never goes down.

Changed in util-linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Kev-inc (kev-inc) wrote :

Yes, it is right; logging in and out on the same tty does not increment the number of users. I had noticed this but forgot to write this particular. To increment the number, you must log in using a new tty.

Kev-inc (kev-inc)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.