Date: Wed, 25 Aug 2010 19:59:42 GMT From: Jan Schaumann <jschauma@netmeister.org> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/149972: usermod -u <non-numeric> should error Message-ID: <201008251959.o7PJxgCq036257@www.freebsd.org> Resent-Message-ID: <201008252000.o7PK0Gmh006097@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 149972 >Category: misc >Synopsis: usermod -u <non-numeric> 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008251959.o7PJxgCq036257>