From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Darrington Subject: Re: [PATCH v4] daemon: Set ownership of kept build directories to the calling user. Date: Fri, 23 Dec 2016 14:33:31 +0100 Message-ID: <20161223133331.GA2589@jocasta.intra> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKPyi-0000eE-CU for guix-devel@gnu.org; Fri, 23 Dec 2016 08:33:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKPye-0005NQ-2O for guix-devel@gnu.org; Fri, 23 Dec 2016 08:33:44 -0500 Received: from de.cellform.com ([88.217.224.109]:51924 helo=jocasta.intra) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cKPyd-0005NC-QF for guix-devel@gnu.org; Fri, 23 Dec 2016 08:33:39 -0500 Content-Disposition: inline In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Vincent Legoll Cc: guix-devel --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 23, 2016 at 12:18:11PM +0100, Vincent Legoll wrote: Hello, =20 + // Change the ownership if clientUid is set. Never change= the + // ownership or the group to "root" for security reasons. + if (settings.clientUid !=3D (uid_t) -1 && settings.client= Uid !=3D 0) { =20 Is "0" a magical value that don't need casting or am I missing somethi= ng ? =20 Presumably clientUid is an unsigned integral type. Hence -1 does need a ca= st, whereas 0 does not. J' --=20 Avoid eavesdropping. Send strong encrypted email. PGP Public key ID: 1024D/2DE827B3=20 fingerprint =3D 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3 See http://sks-keyservers.net or any PGP keyserver for public key. --r5Pyd7+fXNt84Ff3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlhdJ6sACgkQimdxnC3oJ7N+YgCfeOrtJmKZsDj/DhHJ8wicL3yh YOwAn3qEEWDKna1e/8pBVUnTMEADuDql =np81 -----END PGP SIGNATURE----- --r5Pyd7+fXNt84Ff3--