Adduser doesn't roolback when passwords don't match

Bug #53229 reported by Mark Schouten
4
Affects Status Importance Assigned to Milestone
adduser (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: adduser

When adding a user, adduser ask's for a password, twice. If the two don't match, it doesn't clean up the created user but abort's. The result is that the user is created, but with insufficient information.

root@ndcgames-www2:~# id bit-beheer
id: bit-beheer: No such user
root@ndcgames-www2:~# adduser bit-beheer
Adding user `bit-beheer'...
Adding new group `bit-beheer' (1001).
Adding new user `bit-beheer' (1001) with group `bit-beheer'.
Creating home directory `/home/bit-beheer'.
Copying files from `/etc/skel'
Enter new UNIX password:
Retype new UNIX password:
Sorry, passwords do not match
passwd: Authentication information cannot be recovered
adduser: `/usr/bin/passwd bit-beheer' returned error code 10. Aborting.
root@ndcgames-www2:~# adduser bit-beheer
adduser: The user `bit-beheer' already exists.
root@ndcgames-www2:~# id bit-beheer
uid=1001(bit-beheer) gid=1001(bit-beheer) groups=1001(bit-beheer)
root@ndcgames-www2:~# grep bit-beheer /etc/*
/etc/group:bit-beheer:x:1001:
/etc/gshadow:bit-beheer:!::
/etc/passwd:bit-beheer:x:1001:1001::/home/bit-beheer:/bin/bash
/etc/shadow:bit-beheer:!:13346:0:99999:7:::

Whereas Debian clean's up the user which was created:
[11:57][root@net:~] # adduser bit-beheer
Adding user `bit-beheer'...
Adding new group `bit-beheer' (1024).
Adding new user `bit-beheer' (1024) with group `bit-beheer'.
Creating home directory `/home/bit-beheer'.
Copying files from `/etc/skel'
Enter new UNIX password:
Retype new UNIX password:
Sorry, passwords do not match
passwd: Authentication information cannot be recovered
adduser: `/usr/bin/passwd bit-beheer' returned error code 10. Aborting.
Cleaning up.
Removing directory `/home/bit-beheer'
Removing user `bit-beheer'.
Removing group `bit-beheer'.
groupdel: group bit-beheer does not exist
[11:57][root@net:~] # id bit-beheer
id: bit-beheer: No such user

Changed in adduser:
status: Unconfirmed → Confirmed
Revision history for this message
Rok Jaklič (rokj) wrote :

Hi.

Is this bug still relevant? When I try to reproduce this in Feisty Fawn I get something like this:

rokj@majstr:/usr/sbin$ sudo adduser bugtest
Adding user `bugtest' ...
Adding new group `bugtest' (1001) ...
Adding new user `bugtest' (1001) with group `bugtest' ...
The home directory `/home/bugtest' already exists. Not copying from `/etc/skel'.
Enter new UNIX password:
Retype new UNIX password:
Sorry, passwords do not match
passwd: Authentication information cannot be recovered
passwd: password unchanged
Try again? [Y/n] n
Changing the user information for bugtest
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

Should adduser abort and clean after Try again?

Kind regards,

Rok

Revision history for this message
Mark Schouten (mark-prevented) wrote :

I guess this fix would be ok too.

Revision history for this message
Rok Jaklič (rokj) wrote :

Sorry. Which fix? :-)

So, leave as it is in Feisty or should I try to fix it?

Revision history for this message
Mark Schouten (mark-prevented) wrote : Re: [Bug 53229] Re: Adduser doesn't roolback when passwords don't match

On Thu, 2007-07-05 at 10:43 +0000, Rok Jaklič wrote:
> Sorry. Which fix? :-)
>
> So, leave as it is in Feisty or should I try to fix it?

This is fixed. As you get a chance to fix the passwords, and it doesn't
die without cleaning up.

This bug can be closed. Thanks,

Revision history for this message
Mark Schouten (mark-prevented) wrote :

This is fixed

Changed in adduser:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.