From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 25 20:00:17 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6508C1065679 for ; Wed, 25 Aug 2010 20:00:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2D58FC1E for ; Wed, 25 Aug 2010 20:00:17 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7PK0GZU006098 for ; Wed, 25 Aug 2010 20:00:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7PK0Gmh006097; Wed, 25 Aug 2010 20:00:16 GMT (envelope-from gnats) Resent-Date: Wed, 25 Aug 2010 20:00:16 GMT Resent-Message-Id: <201008252000.o7PK0Gmh006097@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jan Schaumann Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B4BB106566C for ; Wed, 25 Aug 2010 19:59:43 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD8E8FC17 for ; Wed, 25 Aug 2010 19:59:43 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PJxgwX036258 for ; Wed, 25 Aug 2010 19:59:42 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o7PJxgCq036257; Wed, 25 Aug 2010 19:59:42 GMT (envelope-from nobody) Message-Id: <201008251959.o7PJxgCq036257@www.freebsd.org> Date: Wed, 25 Aug 2010 19:59:42 GMT From: Jan Schaumann To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/149972: usermod -u should error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 20:00:17 -0000 >Number: 149972 >Category: misc >Synopsis: usermod -u should error >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 Aug 25 20:00:16 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Jan Schaumann >Release: >Organization: >Environment: >Description: pw usermod -d /home/bob -u bob -m yields drwxr-xr-x 2 root wheel 512 Aug 25 12:43 /home/bob Ie, the home directory is owned by root. This makes (some) sense once you realize that "-u" is supposed to take a number: -u uid Specify the user/account numeric id. So I'm guessing that in this case pw(8) determined that there is no UID "bob", and hence created the directory as being owned by root. Now to make the whole story short, I think that if the argument to "-u" is supposed to be numeric, then pw(8) should error out if it is not actually numeric. >How-To-Repeat: pw usermod -d /home/bob -u bob -m >Fix: some sort of atoi checking in src/usr.sbin/pw/pw_user.c >Release-Note: >Audit-Trail: >Unformatted: