all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: John Darrington <john@darrington.wattle.id.au>
Cc: guix-devel <guix-devel@gnu.org>,
	Vincent Legoll <vincent.legoll@gmail.com>
Subject: Re: [PATCH v4] daemon: Set ownership of kept build directories to the calling user.
Date: Fri, 23 Dec 2016 22:15:12 +0100	[thread overview]
Message-ID: <20161223221512.5926b358@scratchpost.org> (raw)
In-Reply-To: <20161223133331.GA2589@jocasta.intra>

On Fri, 23 Dec 2016 14:33:31 +0100
John Darrington <john@darrington.wattle.id.au> wrote:

> On Fri, Dec 23, 2016 at 12:18:11PM +0100, Vincent Legoll wrote:
>      Hello,
>      
>      +            // Change the ownership if clientUid is set. Never change the
>      +            // ownership or the group to "root" for security reasons.
>      +            if (settings.clientUid != (uid_t) -1 && settings.clientUid != 0) {
>      
>      Is "0" a magical value that don't need casting or am I missing something ?
>      
> Presumably clientUid is an unsigned integral type.  Hence -1 does need a cast, whereas
> 0 does not.

Technically I agree. If it was my code I'd cast it regardless.

Also, why use the magical value 0 for gid? Why not likewise (gid_t) -1 ?

  reply	other threads:[~2016-12-23 21:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-23 11:18 [PATCH v4] daemon: Set ownership of kept build directories to the calling user Vincent Legoll
2016-12-23 13:33 ` John Darrington
2016-12-23 21:15   ` Danny Milosavljevic [this message]
2016-12-24 12:34     ` Hartmut Goebel
2016-12-25 23:34       ` Danny Milosavljevic
  -- strict thread matches above, loose matches on Subject: below --
2016-12-08 12:12 [PATCH v3] " Hartmut Goebel
2016-12-08 12:14 ` [PATCH v4] " Hartmut Goebel
2016-12-09 14:23   ` Ludovic Courtès
2016-12-09 14:47     ` Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161223221512.5926b358@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=john@darrington.wattle.id.au \
    --cc=vincent.legoll@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.