Unable to delete currently logged in user
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
shadow (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Trusty |
Fix Released
|
Medium
|
Unassigned | ||
Utopic |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
[SRU justification]
Regression from previous releases, this prevents cloud instance setup processes from removing the default admin account that's exists solely for the purpose of the setup itself.
[Test case]
1. Create a trusty schroot environment
2. Log into the trusty schroot environment as a non-root admin user: schroot -c trusty
3. Attempt to remove the admin account: sudo userdel -f vorlon (warning! do not use -r if your host system's home directory is mounted!)
4. Observe the following error:
userdel: user vorlon is currently used by process 5253
userdel: cannot open /etc/subuid
5. Upgrade to the passwd package from trusty-proposed
6. Attempt to remove the admin account again
7. Verify that the command has succeeded.
[Regression potential]
Minimal, as this is a targeted bugfix to the error handling for subuids.
A user can not delete themselves using the command 'sudo userdel -rf <username>', this is common in cloud tools that clean up running images prior to capture. A quick test shows that this worked from Precise (didn't look back further) to Raring and stopped working with Saucy.
Here's a quick example of the failure (from trusty):
# sudo adduser test
# sudo usermod -aG sudo test
## As the 'test' user
# sudo userdel -rf test
userdel: user test is currently used by process 9600
userdel: cannot open /etc/subuid
## User is not removed
Previously (output from precise)
# sudo userdel -rf test
userdel: user test is currently logged in
userdel: warning: can't remove /var/mail/test: No such file or directory
## User is removed
This is being run as the last command by tools that remove the 'ubuntu' user to clean the image prior to capture. This had previously worked and it is preferable that this could be made to work again. The alternative is removal by root, but the root user on cloud images is locked down and we would not want the user to enable root to run userdel on the risk of it not getting disabled properly prior to image capture.
Changed in shadow (Ubuntu): | |
status: | New → Fix Committed |
status: | Fix Committed → New |
Changed in shadow (Ubuntu Utopic): | |
importance: | Undecided → Medium |
Changed in shadow (Ubuntu Trusty): | |
importance: | Undecided → Medium |
tags: | added: trusty utopic |
tags: | added: vivid |
Changed in shadow (Ubuntu Trusty): | |
status: | Won't Fix → Triaged |
Changed in shadow (Ubuntu Utopic): | |
status: | Won't Fix → Triaged |
Changed in shadow (Ubuntu): | |
status: | Triaged → Fix Released |
description: | updated |
Changed in shadow (Ubuntu Utopic): | |
status: | Fix Committed → Won't Fix |
Status changed to 'Confirmed' because the bug affects multiple users.