ubuntu / ubuntu/lightdm

when a user login with lightdm with any greeter and type last, it will show "gone - no logout"

Open
#239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

I tested this on focal 20.4.4 LTS. I used lightdm version 1.30.0-0ubuntu4~20.04.2.

How to reproduce.
  1. install ubuntu 20.04.4 LTS and use lightdm.
  2. login through lighdm
  3. type last

I will see

user tty7    :0    Fri Mar 18 14:14    gone - no logout
Something else

I am still not sure if this needs to be addressed in lightdm or last. In the last program, when it comes to decide if this is a phantom or not, it will check pw->pw_uid (from getpwnam) and /proc/pid/loginuid and if they are not the same, last will say this is a phantom process [1].

I found the pid of lightdm from using ps -ef | grep lightdm or extract pid in /var/log/wtmp, and manually compare it with a test program where I used getpwnam. The value of getpwnam is correct, but the value of /proc/pid/loginuids is a very big number. I guess this is because the owner of lightdm process is root on my machine, and whilst I used gdm3, it is the normal user.

[1] https://github.com/util-linux/util-linux/blob/master/login-utils/last.c#L635

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on Ubuntu 20.04.4 with LightDM 1.30.0-0ubuntu4~20.04.2, then inspect login-utils/last.c around the phantom-process check and compare /proc/pid/loginuid with getpwnam results. Trace the LightDM process involved in the wtmp entry and determine whether LightDM or last should change; done means the session no longer appears as “gone - no logout” when the user is logged in.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
authentication, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.