From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: Re: [Patch v2] daemon: Set ownership of kept build directories to the calling user. Date: Mon, 28 Nov 2016 22:31:44 +0100 Message-ID: References: <1479382225-25227-1-git-send-email-h.goebel@crazy-compilers.com> <87shqkvs3a.fsf@gnu.org> <58330253.60805@crazy-compilers.com> <87inr8ljm6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBTWh-0006mC-Jl for guix-devel@gnu.org; Mon, 28 Nov 2016 16:31:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBTWd-0005H8-LT for guix-devel@gnu.org; Mon, 28 Nov 2016 16:31:51 -0500 In-Reply-To: <87inr8ljm6.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=c3=a8s?= Cc: guix-devel@gnu.org Am 27.11.2016 um 22:04 schrieb Ludovic Court=C3=A8s: > The problem is that 0 also means =E2=80=9Croot=E2=80=9D, so I=E2=80=99d= prefer a different value > to denote that =E2=80=9Cunset=E2=80=9D status, -1 if you want, and expl= icit checks (and > a comment explaining that =E2=80=98clientUid=E2=80=99 and =E2=80=98clie= ntGid=E2=80=99 can be either a > valid UID/GID or -1, in which case blablabla). > > How does that sound? This basically sounds reasonable. I just need some C programming hint: uid_t is an unsigned int, so comparing with -1 raises a warning (which IMO is the same as en error). And casting uid_t to unisgned int might return the same uid as "nobody". How can I solve this? --=20 Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |