From owner-freebsd-stable@freebsd.org Mon Jul 13 07:04:17 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC2E99B945 for ; Mon, 13 Jul 2015 07:04:17 +0000 (UTC) (envelope-from janm@transactionware.com) Received: from mail3.transactionware.com (mail.transactionware.com [203.14.245.7]) by mx1.freebsd.org (Postfix) with SMTP id 3F3471AF1 for ; Mon, 13 Jul 2015 07:04:16 +0000 (UTC) (envelope-from janm@transactionware.com) Received: (qmail 3966 invoked by uid 907); 13 Jul 2015 06:57:33 -0000 Received: from Unknown (HELO jmmacpro.tmst.com.au) (203.14.245.130) (smtp-auth username janm, mechanism plain) by mail3.transactionware.com (qpsmtpd/0.84) with (ECDHE-RSA-AES256-SHA encrypted) ESMTPSA; Mon, 13 Jul 2015 16:57:33 +1000 From: Jan Mikkelsen Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: 10.2-BETA1: pw(8) does not support "pw useradd name -u 0" Message-Id: <00BBEBAC-D7E2-4312-995B-93F7F0EDDD42@transactionware.com> Date: Mon, 13 Jul 2015 16:57:32 +1000 To: FreeBSD Stable Mailing List , bapt@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) X-Mailer: Apple Mail (2.2102) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 07:04:18 -0000 Hi, In our system build scripts we have this command: /usr/sbin/pw -V $d useradd toor -u 0 -g 0 -d /root -s /bin/sh -c = "Bourne-again Superuser" -g wheel -o After 10.2-BETA1, the toor account is being added with UID 1001 instead = of UID 0. This looks like a problem with line 754 in pw_user.c, which = has this test: /* * Check the given uid, if any */ if (id > 0) { uid =3D (uid_t) id; if ((pwd =3D GETPWUID(uid)) !=3D NULL && = conf.checkduplicate) errx(EX_DATAERR, "uid `%u' has already been = allocated", pwd->pw_uid); } else { struct bitmap bm; The (id > 0) test should probably be (id >=3D 0) to allow =E2=80=9C-u = 0=E2=80=9D to be passed on the command line. This change is from r285092 by bapt@. Was this change in behaviour = intentional? Regards, Jan Mikkelsen