Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 28 Nov 2001 13:03:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 28 Nov 2001 13:03:37 -0500 Received: from c38889-c.grlnd1.tx.home.com ([24.4.38.23]:4994 "HELO webby.quo.to") by vger.kernel.org with SMTP id ; Wed, 28 Nov 2001 13:03:23 -0500 Message-ID: <000901c17836$f6a88190$024d460a@neptune> From: "Jordan Russell" To: "Giuliano Pochini" Cc: In-Reply-To: Subject: Re: Small security bug with misconfigured access rights Date: Wed, 28 Nov 2001 12:03:20 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Giuliano Pochini wrote: > Well, I don't know if it is really a bug. > > Create a directory like this: > > # ls -la > total 12 > drwxr-sr-x 2 pochini root 4096 Nov 28 16:33 . > drwxr-xr-x 32 pochini users 8192 Nov 28 16:25 .. > > Sgid bit is set and the directory is owned by me and the > group is root (yes, it shouldn't be). > > When I create a file here, it gets the root group even > if I don't belong to it. That's the correct behavior. Quoting "man mount": grpid or bsdgroups / nogrpid or sysvgroups These options define what group id a newly created file gets. When grpid is set, it takes the group id of the directory in which it is created; otherwise (the default) it takes the fsgid of the current pro- cess, unless the directory has the setgid bit set, in which case it takes the gid from the parent directory, and also gets the setgid bit set if it is a directory itself. Jordan Russell - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/