Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758761AbYFDIpX (ORCPT ); Wed, 4 Jun 2008 04:45:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751824AbYFDIpJ (ORCPT ); Wed, 4 Jun 2008 04:45:09 -0400 Received: from fxip-0047f.externet.hu ([88.209.222.127]:55005 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbYFDIpI (ORCPT ); Wed, 4 Jun 2008 04:45:08 -0400 To: mtk.manpages@googlemail.com CC: miklos@szeredi.hu, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, hch@lst.de, viro@zeniv.linux.org.uk, jamie@shareable.org, drepper@redhat.com, linux-fsdevel@vger.kernel.org, subrata@linux.vnet.ibm.com In-reply-to: (mtk.manpages@googlemail.com) Subject: Re: [parch 4/4] vfs: utimensat(): fix write access check for futimens() References: <4845C4D2.8050408@gmail.com> Message-Id: From: Miklos Szeredi Date: Wed, 04 Jun 2008 10:44:39 +0200 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1021 Lines: 25 > On Wed, Jun 4, 2008 at 7:54 AM, Miklos Szeredi wrote: > >> At which point the "if (f)" and the "else" branches become equivalent > >> (the nameidata isn't interesting in the other case either). So that > >> could be written as: > >> > >> if (!is_owner_or_cap(inode)) { > >> error = permission(inode, MAY_WRITE, NULL); > >> if (error) > >> goto mnt_drop_write_and_out; > >> } > > > > And also the IS_IMMUTABLE() check can be removed, since it's checked > > by permission(MAY_WRITE) anyway. > > I'm not sure that that is true, because immutability applies > regardless of capabilities or ownership, right? Yeah, you're right. I misread that. Miklos -- 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/