From owner-freebsd-bugs Wed Apr 18 8:50: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2206E37B43C for ; Wed, 18 Apr 2001 08:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3IFo2v31257; Wed, 18 Apr 2001 08:50:02 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3ACC037B424 for ; Wed, 18 Apr 2001 08:47:23 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3IFlNx24895; Wed, 18 Apr 2001 08:47:23 -0700 (PDT) (envelope-from nobody) Message-Id: <200104181547.f3IFlNx24895@freefall.freebsd.org> Date: Wed, 18 Apr 2001 08:47:23 -0700 (PDT) From: dan@freebsddiary.org To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/26674: rmuser xyz reports incorrect error message if xyz does not exist Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 26674 >Category: bin >Synopsis: rmuser xyz reports incorrect error message if xyz does not exist >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 18 08:50:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Dan Langille >Release: 4.3-BETA >Organization: The FreeBSD Diary / FreshPorts >Environment: FreeBSD ns1.unixathome.org 4.3-BETA FreeBSD 4.3-BETA #1: Tue Mar 13 16:03:23 NZD T 2001 root@xeon.int.nz.freebsd.org:/usr/obj/usr/src/sys/DUCKY i386 >Description: if you use rmuser to remove a user which does not exist, the message is: /usr/sbin/rmuser: Error: I'd rather not remove a user with a uid of 0. The message should be: /usr/sbin/rmuser: Error: User xyz not in password database >How-To-Repeat: Remove a user which does not exist # grep xyz /etc/passwd # rmuser xyz /usr/sbin/rmuser: Error: I'd rather not remove a user with a uid of 0. # >Fix: The problem appears to be with the return value from getpwnam. Here's some code from /usr/sbin/rmuser. mux is hunting around for more info. ($name, $password, $uid, $gid, $change, $class, $gecos, $home_dir, $shell) = (getpwnam("$login_name")); if ($?) { print STDERR "${whoami}: Error: User ${login_name} not in password database\ &unlockpw; exit 1; } if ($uid == 0) { print "${whoami}: Error: I'd rather not remove a user with a uid of 0.\n"; &unlockpw; exit 1; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message