From owner-svn-src-all@FreeBSD.ORG Tue Jan 27 23:44:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D10660E; Tue, 27 Jan 2015 23:44:25 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11409E0B; Tue, 27 Jan 2015 23:44:25 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id h11so5663446wiw.0; Tue, 27 Jan 2015 15:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=E31Rtm8mNfH3k8o2njjK5Tqtb6lqqtkO+KAEJbV4pyk=; b=SEWDzAwzJjGb6N3igrwyq/ATzaUtquDHwyibbAGyY96Zkgyk5rfz900MH4GTHHMm4s LeTgACH6r2dhI7ltNwM7bHPKSKfei0FSL1PvyZOjU/OPJHvqHoaOMMmFz0bkvLmk1SQ5 tmJwWF/ZxfdhOTLJuh+cugtp6Gqxr/+Z7VQmT6sC7tSLpAX1E7Gc3x7FFUR7WCpK0YJX kqlbQU01A5rHAUpv5XW90ELqzejO00k0wVDytRdEtv4xhcDwhy3Mc1gJNFvmQiDIgm8u p4oHZqov8gy8vRURdICGkaDCIu68PTr62W0RkmmvdtWaJoWTAr9K9IfCCJdrLtPyvroF 7sKA== X-Received: by 10.194.24.195 with SMTP id w3mr777020wjf.135.1422402263017; Tue, 27 Jan 2015 15:44:23 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id ud9sm497670wib.5.2015.01.27.15.44.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jan 2015 15:44:22 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 28 Jan 2015 00:44:20 +0100 From: Baptiste Daroussin To: Devin Teske Subject: Re: svn commit: r277652 - in head/usr.sbin/pw: . tests Message-ID: <20150127234420.GB84622@ivaldir.etoilebsd.net> References: <201501241913.t0OJD4xT039188@svn.freebsd.org> <20150125155254.V1007@besplex.bde.org> <20150125142148.GA76051@zxy.spb.ru> <20150126014336.P2572@besplex.bde.org> <5D58B34B-8647-4B69-8D90-E7D37C98D4AD@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline In-Reply-To: <5D58B34B-8647-4B69-8D90-E7D37C98D4AD@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Slawa Olhovchenkov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2015 23:44:25 -0000 --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 26, 2015 at 01:20:28PM -0800, Devin Teske wrote: >=20 > > On Jan 25, 2015, at 7:31 AM, Bruce Evans wrote: > >=20 > > On Sun, 25 Jan 2015, Slawa Olhovchenkov wrote: > >=20 > >> On Sun, Jan 25, 2015 at 04:56:24PM +1100, Bruce Evans wrote: > >>=20 > >>> Negative ids have historical abuses in places like mountd. >=20 > Which paves the way for the =E2=80=9Caccepted practice=E2=80=9D argument > and backed up by =E2=80=9Cin-the-field usage=E2=80=9D statement(s). >=20 >=20 >=20 > >>> mountd still > >>> hard-codes -2 and -2 for the default uid and gid of an unprivileged u= ser. > >>> It at least casts these values to uid_t and gid_t before using them. > >>> This gives the ids the non-random values of UINT32_MAX-1 if uid_t and > >>> gid_t are uint32_t. (If uid_t and gid_t were signed, then it would > >>> leave the values as negative, so invalid.) These magic values may wo= rk > >>> better than when ids were 16 bits, since there is less risk of them > >>> conflicting with a normal id. However, the non-conflict is probably > >>> a bug. FreeBSD uses the magic ids of 65534 for user nobody: group > >>> nobody. These would have been (id_t)-2 with 16-bit ids. They no > >>> longer match, so ls displays (id_t)-2 numerically. FreeBSD also has > >>> a group nogroup =3D 65553 that doesn't match the nfs usage. However2, > >>> in FreeBSD-1 wher ids were 16-bits, nobody was 32767 and nogroup was > >>> 32766. so they didn't match nfs for other reasons. The 2 non-groups > >>> now seem to be just a bug -- FreeBSD-1 didn't have group nobody. > >>> 4.4BSD-Lite2 has the same values as FreeBSD-1. > >>=20 > >> This is not full true for ZFS case. > >> On ZFS nobody is 2^32-2. > >=20 > > File systems don't get to decide this. >=20 > +1 (and thanks for the historical account, bruce =E2=80=94 sincerely) >=20 > However, I still want to make the argument that: >=20 > a. Because we=E2=80=99ve supported mapping negative inputs to unsigned va= lues in pw *for over a decade*, that=E2=80=A6 >=20 > b. We should either revert or make a relnotes submission to note that we= =E2=80=99re changing the long-standing accepted practice. >=20 > Changing the accepted practice broke code internally, it would have likel= y broken some external code as well =E2=80=94 and people deserve to know ab= out said change else we should continue to support accepted practice that i= s decade(s) old. It has never been accepted by pw(8) it was just not checked as a result it = was accepting *anything* and passed it unchecked directly to atoi(3) resulting = in for example pw groupdel -u plop removing wheel... or pw userdel -u something trying to delete root. (was this an accepted behaviour for a decade as well= ?) Regards, Bapt --f0KYrhQ4vYSV2aJu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTIItMACgkQ8kTtMUmk6ExVwwCdE5V/XAfKZ3K6u9iGm4EUBVmX nYUAoKkQoztNiDHI7ipKwqAzTYZKTV6/ =kC0r -----END PGP SIGNATURE----- --f0KYrhQ4vYSV2aJu--