From owner-freebsd-questions@FreeBSD.ORG Thu Mar 3 01:41:50 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1735E106566B for ; Thu, 3 Mar 2011 01:41:50 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id D8FC58FC1A for ; Thu, 3 Mar 2011 01:41:49 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id p231n00R054900; Wed, 2 Mar 2011 19:49:00 -0600 (CST) Date: Wed, 2 Mar 2011 19:49:00 -0600 (CST) From: Robert Bonomi Message-Id: <201103030149.p231n00R054900@mail.r-bonomi.com> To: demelier.david@gmail.com, freebsd-questions@freebsd.org In-Reply-To: <4D6ECA01.40002@gmail.com> Cc: Subject: Re: Question about nethack and setgid X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2011 01:41:50 -0000 > Date: Wed, 02 Mar 2011 23:51:45 +0100 > From: David Demelier > To: freebsd-questions@freebsd.org > Subject: Question about nethack and setgid > > 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 1 games games 1793635 25 Jan 2011 > /usr/local/lib/nethack/nethack > > So that means people in games group will run nethack as games user (owner > of file) Actually, it means that the program will run with the _group_ id of the file -- i.e. the 'games' group. _That_ 's' is the 'sgid' or 'set groupID' bit. > 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-- games games Lo and behold! The file _is_ writable by the games group. > I'm writing a game that will store file too, because I can't make it > works like nethack I was planning using the setuid mode but I don't like > much this .. > > What am I misunderstanding? the function of the 'setgid' bit. > Cheers, > > -- > David Demelier > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions To > unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >