Date: Mon, 13 Jul 2015 10:36:28 +0200 From: Baptiste Daroussin <bapt@freebsd.org> To: Jan Mikkelsen <janm@transactionware.com> Cc: FreeBSD Stable Mailing List <freebsd-stable@freebsd.org> Subject: Re: 10.2-BETA1: pw(8) does not support "pw useradd name -u 0" Message-ID: <20150713083628.GA37597@ivaldir.etoilebsd.net> In-Reply-To: <00BBEBAC-D7E2-4312-995B-93F7F0EDDD42@transactionware.com> References: <00BBEBAC-D7E2-4312-995B-93F7F0EDDD42@transactionware.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 13, 2015 at 04:57:32PM +1000, Jan Mikkelsen wrote: > Hi, >=20 > In our system build scripts we have this command: >=20 > /usr/sbin/pw -V $d useradd toor -u 0 -g 0 -d /root -s /bin/sh -c "Bourne-= again Superuser" -g wheel -o >=20 > After 10.2-BETA1, the toor account is being added with UID 1001 instead o= f UID 0. This looks like a problem with line 754 in pw_user.c, which has th= is test: >=20 > /* > * Check the given uid, if any > */ > if (id > 0) { > uid =3D (uid_t) id; >=20 > if ((pwd =3D GETPWUID(uid)) !=3D NULL && conf.checkduplic= ate) > errx(EX_DATAERR, "uid `%u' has already been alloc= ated", pwd->pw_uid); > } else { > struct bitmap bm; >=20 >=20 > 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. >=20 > This change is from r285092 by bapt@. Was this change in behaviour intent= ional? Nope, I'll fix asap Thanks for reporting Best regards, Bapt --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWjeIwACgkQ8kTtMUmk6ExPHQCeJEVB1w5N/1POLy5KzbyD8jnG ljIAoIDz/2L2J1dj1aqwUXW5CEFPk6tU =dMJh -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150713083628.GA37597>