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, 5 Dec 2016 21:51:51 +0100 Message-ID: <5a0a09c4-3ace-550e-545a-3a7071baee4f@crazy-compilers.com> 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> <20161201010110.2325efc9@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE0Ev-0002pA-IB for guix-devel@gnu.org; Mon, 05 Dec 2016 15:51:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cE0Es-0002Se-Hw for guix-devel@gnu.org; Mon, 05 Dec 2016 15:51:57 -0500 In-Reply-To: <20161201010110.2325efc9@scratchpost.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: Danny Milosavljevic Cc: guix-devel@gnu.org Am 01.12.2016 um 01:01 schrieb Danny Milosavljevic: > So I'd say to compare with (uid_t)-1 would be fine > > if (settings.clientUid != (uid_t) -1) { > ... > } Thanks for this tip, Danny. This made it work and I just posted the updated patch. > > And casting uid_t to unisgned int might return the same uid as "nobody". > [...] > > (-1) in two-complement 16 bit integral encoding (which is technically not guaranteed to be used in C) would be 65535. Ahh, well, yes. I'm not quite good on bit operations, esp. on representations of negative numbers. Thanks to doing this right. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |