Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#868568: adduser - deluser command says user has running processes when user has a custom UID assigned

58 views
Skip to first unread message

Niels Hendriks

unread,
Jul 16, 2017, 2:30:03 PM7/16/17
to
Package: adduser
Version: 3.115
OS: Debian 9 amd64

Linux debian 4.9.15-x86_64-linode81 #1 SMP Fri Mar 17 09:47:36 EDT 2017 x86_64 GNU/Linux

dpkg -s libc6 | grep ^Version
Version: 2.24-11

Hello,

On a clean Debian 9 amd64 install the deluser command detects running processes from the user I am trying to delete, while no processes are running under that user. This is only the case when the user has a special UID assigned.

Steps to reproduce on a clean Debian 9 install. I did this on a Linode upon the first login with SSH as root:

adduser foo
adduser foo1234 --uid 101234
adduser foo1234 sudo
su - foo1234
sudo su -
# enter sudo password
deluser foo

This gives the following output:

root@debian:~# adduser foo
Adding user `foo' ...
Adding new group `foo' (1000) ...
Adding new user `foo' (1000) with group `foo' ...
Creating home directory `/home/foo' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for foo
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y
root@debian:~# adduser foo1234 --uid 101234
Adding user `foo1234' ...
Adding new group `foo1234' (101234) ...
Adding new user `foo1234' (101234) with group `foo1234' ...
Creating home directory `/home/foo1234' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for foo1234
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y
root@debian:~# adduser foo1234 sudo
Adding user `foo1234' to group `sudo' ...
Adding user foo1234 to group sudo
Done.
root@debian:~# su - foo1234
foo1234@debian:~$ sudo su -
[sudo] password for foo1234:
root@debian:~# deluser foo
Removing user `foo' ...
Warning: group `foo' has no more members.
userdel: user foo is currently used by process 4892
/usr/sbin/deluser: `/usr/sbin/userdel foo' returned error code 8. Exiting.
root@debian:~#
root@debian:~# ps aux | grep 4892
foo1234   4892  0.0  0.4  20936  4740 pts/0    S    17:54   0:00 -su
root      4917  0.0  0.0  12788   940 pts/0    S+   17:55   0:00 grep 4892


As you can see I am unable to delete the user foo because of the running process with pid 4892, which is actually the process from user foo1234

When I do not assign a specific UID to the user foo1234 it works correctly and as expected.

I also used specific UIDs in debian 8, and this issue did not pop up there. It seems to be new in debian 9.

This is my first bug report to Debian so I hope all required information is present and that you are able to reproduce it with the above steps.

Thanks,
Niels Hendriks

Afif Elghraoui

unread,
Aug 13, 2017, 12:00:03 AM8/13/17
to
Control: reassign -1 passwd

Hello,

I'm sorry for the delay. As far as Debian Unstable goes, I cannot
reproduce the issue on a clean VM, so it may be limited to Stretch as
you said. In any case, this part:

> root@debian:~# deluser foo
> Removing user `foo' ...
> Warning: group `foo' has no more members.
> userdel: user foo is currently used by process 4892
> /usr/sbin/deluser: `/usr/sbin/userdel foo' returned error code 8. Exiting.

shows that the error is coming from userdel. deluser issued the command
`/usr/bin/userdel foo` and userdel gave you this message. I'm therefore
reassigning this ticket to the passwd package, which is where userdel
comes from. You should hear from its maintainers as a result.

regards
Afif

--
Afif Elghraoui | عفيف الغراوي
http://afif.ghraoui.name

Serge E. Hallyn

unread,
Mar 8, 2022, 1:40:03 PM3/8/22
to
So deluser was doing the right thing, right?

The bug is how you got into this state? Either the adduser for
the high uid should have checked for it being a delegated subuid,
or the adduser which added the subuids to the lower subuid should
have refused when the higher subuid existed as a uid.

On Tue, Mar 08, 2022 at 05:31:41PM +0000, Ben Harris wrote:
> I ran into a problem very similar to the one described in Debian bug 868568:
> deleting a user with a UID < 100000 failed because of a process that was
> running as a user with a UID >= 100000. It turned out to be because the
> larger user ID was recorded in /etc/subuid as a subordinate user-ID for the
> lower-numbered user. Blanking out /etc/subuid and /etc/subgid caused
> deluser to behave as normal.
>
> According to login.defs(5), the default range of subuids starts at 100000.
> If you're using UIDs over 100000 for normal users then you probably want to
> change that (or find a way to disable subordinate user-IDs entirely).
>
> --
> Ben Harris, University of Cambridge Information Services.
>
> _______________________________________________
> Pkg-shadow-devel mailing list
> Pkg-shad...@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-shadow-devel
0 new messages