Comment 43 for bug 458883

Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

Good news guys! I've been able to reproduce the bug (no idea why I wasn't seeing it before), which actually has nothing to do with the error we were seeing.

The problem comes from the deluser command that does not set the PATH it is using to find the userdel command, which is used in the end to removed the user. Since when run through D-Bus, the system-tools-backends do not pass any PATH to deluser, it was not working - while using sudo inherited the original user's PATH.

This is a minor mistake that could also lead to trouble if the user PATH was set to something funny, since deluser could end up running unwanted commands. Not very likely, but absolutely wrong. Attached is a patch that merely copies what adduser already does, i.e. setting the PATH to something correct to avoid all those issues. You can apply it using
sudo patch /usr/sbin/deluser < [PATH TO THE FILE]

I think it also applied for a Stable Release Update, since users deletion is completely broken using the GUI.