From owner-freebsd-questions@FreeBSD.ORG Thu Mar 3 08:55:51 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 033011065672 for ; Thu, 3 Mar 2011 08:55:51 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7E9588FC08 for ; Thu, 3 Mar 2011 08:55:50 +0000 (UTC) Received: by bwz12 with SMTP id 12so1012748bwz.13 for ; Thu, 03 Mar 2011 00:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=gHvcWA/mULw5B86xGqnpUfXp9YrBVKOlF5OXO/3vaRQ=; b=gY9ochULOl8DaLh5d/8VQcTnZ2rZ6t81opOr4T9UMq9VEljVR/A25Dw/yZqFgScfMJ 9s+o3aWKm1xWLNyWZss1OYB7KX8SwoWIxdF1YX5EsMnKr40ma5j+utLX/4EliKpvyx03 pxKrp6eiiipkdty48YCqp+Qbikv1mmggVZt5Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=auqkc9LckRRF71IA+VrB76Au261Zxqvu1Lw1w9IqNMGXhL9JIiHOGg/hQnLH/1oWx3 oJ8fgrFWwlMBFhGWscpKSi3zwkkKX8ddYD4n6h0k/3aQgVOr+og6m4Cg6IEFho39InQd IABNxp3lAbZ9p7dQ/AcCjyg7TXAtoKASO5HwY= Received: by 10.204.35.150 with SMTP id p22mr1115475bkd.83.1299142549260; Thu, 03 Mar 2011 00:55:49 -0800 (PST) Received: from Melon.malikania.fr (65.21.102-84.rev.gaoland.net [84.102.21.65]) by mx.google.com with ESMTPS id x6sm572353bkv.12.2011.03.03.00.55.47 (version=SSLv3 cipher=OTHER); Thu, 03 Mar 2011 00:55:48 -0800 (PST) Message-ID: <4D6F5764.6000109@gmail.com> Date: Thu, 03 Mar 2011 09:55:00 +0100 From: David Demelier User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.14) Gecko/20110302 Thunderbird/3.1.8 MIME-Version: 1.0 To: Robert Bonomi References: <201103030149.p231n00R054900@mail.r-bonomi.com> In-Reply-To: <201103030149.p231n00R054900@mail.r-bonomi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org 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 08:55:51 -0000 On 03/03/2011 02:49, Robert Bonomi wrote: >> 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" >> -- David Demelier