[Adduser-devel] Bug#469165: /usr/sbin/deluser: deluser thinks I want to remove the root user

Joerg Hoh joerg at joerghoh.de
Mon Mar 3 20:31:09 UTC 2008


Hi

On Mon, Mar 03, 2008 at 03:19:35PM +0100, Bram Senders wrote:
> Package: adduser
> Version: 3.106
> Severity: important
> File: /usr/sbin/deluser
> 
> Deluser gives an error and then thinks I want to remove the root user.
> See the following transcript:
> 
> ===
> bram at tofu ~> sudo deluser --remove-all-files test
> Use of uninitialized value in numeric eq (==) at /usr/sbin/deluser line 228.
> WARNING: You are just about to delete the root account (uid 0)
> Usually this is never required as it may render the whole system unusable
> Press immediately Ctrl+C if you want to abort
> ===
> 
> The referenced line 228 contains the following: "if ($uid == 0) {", so I
> guess $uid does not get set; this might be because the "getpwnam($user)"
> call on line 211 is only done if the "system" config parameter is set.

The correct variable would be "$pw_uid" which is always initialized with
the data of the user to delete (see line 173); the patch will go into next
release. Thanks for reporting.

Jörg

-- 
What did you do to the cat? It looks half-dead. -Schroedinger's wife
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/adduser-devel/attachments/20080303/8cc546de/attachment.pgp 


More information about the Adduser-devel mailing list