Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Mar 2011 18:54:41 -0600
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        David Demelier <demelier.david@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Question about nethack and setgid
Message-ID:  <AANLkTinjCzGqTO2E5dTWhZJhHGohoW5jtR-CcxKUHCoo@mail.gmail.com>
In-Reply-To: <4D6ECA01.40002@gmail.com>
References:  <4D6ECA01.40002@gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Wed, Mar 2, 2011 at 4:51 PM, David Demelier <demelier.david@gmail.com> w=
rote:
> Hello,
>
> I don't understand how nethack can store the score in
> /usr/local/lib/nethack/logfile.
>
> the real binary is here /usr/local/lib/nethack/nethack
>
> And the mode is
>
> -rwxr-sr-x =A01 games =A0games =A01793635 25 Jan 2011
> /usr/local/lib/nethack/nethack
>
> So that means people in games group will run nethack as games user (owner=
 of
> file) but I'm not in games group ! and I can save the file located in
>
> /usr/local/lib/nethack/logfile which mode is -rw-rw-r-- =A0games =A0games
>
> I'm writing a game that will store file too, because I can't make it work=
s
> like nethack I was planning using the setuid mode but I don't like much t=
his
> ..
>
> What am I misunderstanding?
>
> Cheers,
>
> --
> David Demelier

Take a look at:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/permissions.html#=
AEN4027

I believe that it will demystify the behavior you're seeing.

-Brandon



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?AANLkTinjCzGqTO2E5dTWhZJhHGohoW5jtR-CcxKUHCoo>