passwd and group entries are not removed on logout from a guest session
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lightdm (Ubuntu) |
Fix Released
|
Low
|
Gunnar Hjalmarsson |
Bug Description
When a guest session is finished, the guest-xxxx entries don't get removed from /etc/passwd and /etc/group (at least they don't always get removed). The problem is that the userdel command in the /usr/sbin/
The simplest fix is to just call userdel with the --force flag, so that it removes the password and group entries even if the processes are still there. This doesn't cause any problems. The lingering guest-xxxx processes are gone by the time you log in as a regular user.
A trivial patch file for /usr/sbin/
Here is the tail of some debugging output that I obtained by modifying /usr/sbin/
+ GUEST_HOME=
+ [ -x /bin/loginctl ]
+ loginctl kill-user guest-8iwujo
+ [ /tmp/guest-8iwujo = guest-8iwujo ]
+ umount /tmp/guest-8iwujo
umount: /tmp/guest-8iwujo: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
+ umount -l /tmp/guest-8iwujo
+ umount /tmp/guest-8iwujo
umount: /tmp/guest-8iwujo: not mounted
+ umount -l /tmp/guest-8iwujo
umount: /tmp/guest-8iwujo: not mounted
+ true
+ umount /tmp/guest-8iwujo
umount: /tmp/guest-8iwujo: not mounted
+ umount -l /tmp/guest-8iwujo
umount: /tmp/guest-8iwujo: not mounted
+ true
+ rm -rf /tmp/guest-8iwujo
+ xargs -0 rm -rf
+ find /tmp -mindepth 1 -maxdepth 1 -uid 999 -print0
+ [ -d /run/media/
+ [ -d /media/guest-8iwujo ]
+ ps -lww -u guest-8iwujo
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 S 999 7128 1 0 80 0 - 88460 poll_s ? 00:00:00 at-spi-bus-laun
0 R 999 7214 1 0 80 0 - 162593 - ? 00:00:00 nm-applet
0 R 999 7222 1 1 80 0 - 138676 - ? 00:00:00 tilda
+ userdel guest-8iwujo
userdel: user guest-8iwujo is currently used by process 7128
summary: |
- passwd and group entries are not removed on logout + passwd and group entries are not removed on logout from a guest session |
affects: | lightdm → lightdm (Ubuntu) |
Changed in lightdm: | |
status: | New → Fix Committed |
no longer affects: | lightdm |
Attached is the wrapper that I used to capture the output of the guest account script when it is run from lightdm. Rename this to /usr/sbin/ guest-account to use it.