Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbYJ0PTj (ORCPT ); Mon, 27 Oct 2008 11:19:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751246AbYJ0PTa (ORCPT ); Mon, 27 Oct 2008 11:19:30 -0400 Received: from khc.piap.pl ([195.187.100.11]:33383 "EHLO khc.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbYJ0PT3 (ORCPT ); Mon, 27 Oct 2008 11:19:29 -0400 To: Dmitri Monakhov Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] kill suid bit only for regular files References: <1224424839-3892-1-git-send-email-dmonakhov@openvz.org> <20081026214741.332c7656.akpm@linux-foundation.org> From: Krzysztof Halasa Date: Mon, 27 Oct 2008 16:19:26 +0100 In-Reply-To: (Dmitri Monakhov's message of "Mon\, 27 Oct 2008 10\:41\:52 +0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 964 Lines: 22 Dmitri Monakhov writes: >> Are we sure that should_remove_suid() is not and never will used for >> directories? > This bits are meaningless for directory. Posix is quiet about this case. > Ok. Will do. My point is: it is improbable what some body(except me :) ) > want to set S_ISUID/S_ISGID bit for non regular files. But it is > technically possible and result in unexpected consequence. I don't know about the context, but SGID bits for directories are not magic, they mean the newly created files will inherit GID from the parent directory, and if the file is actually a subdirectory, it will also have SGID set. The same was also true WRT SUID bits on some systems. -- Krzysztof Halasa -- 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/