git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] Added support for dropping privileges to git-daemon.
Date: Sat, 19 Aug 2006 17:19:30 +0200	[thread overview]
Message-ID: <e5bfff550608190819i3cade548g28b2c95fab172a49@mail.gmail.com> (raw)
In-Reply-To: <20060819132922.GA6644@code-monkey.de>

On 8/19/06, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> Marco Costalba [2006-08-19 15:23]:
> > >
> > >+       if (!user ^ !group)
> > >+               die("either set both user and group or none of them");
> > >+
> > >
> >
> > Just a  question. Why simply not
> >
> >       if (user ^ group)
>
> Because gcc doesn't like that:
>  error: invalid operands to binary ^
>

Interesting!

Indeed gcc it's right, operator ^ it's a bitwise operator, not a
logical one. So operands must be booleans (or numerical types in case
of C).

The trick is that operator '!' performs an implicit conversion to
integral on the 'user' and 'group' pointers.

BTW the following (very ugly) works.

         if ((int)user ^ (int)group)

  reply	other threads:[~2006-08-19 15:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-19 12:27 [PATCH] Added support for dropping privileges to git-daemon Tilman Sauerbeck
2006-08-19 13:23 ` Marco Costalba
2006-08-19 13:29   ` Tilman Sauerbeck
2006-08-19 15:19     ` Marco Costalba [this message]
2006-08-19 15:22       ` Marco Costalba
2006-08-19 17:15       ` Mitchell Blank Jr
2006-08-19 13:32 ` Johannes Schindelin
2006-08-19 17:25 ` Mitchell Blank Jr
2006-08-19 12:27   ` Tilman Sauerbeck
2006-08-22  6:38     ` Junio C Hamano
2006-08-22 17:37       ` Tilman Sauerbeck
2006-08-22 23:40         ` Junio C Hamano
2006-08-23 16:45           ` Tilman Sauerbeck

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=e5bfff550608190819i3cade548g28b2c95fab172a49@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).