Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757295AbcLBJXF (ORCPT ); Fri, 2 Dec 2016 04:23:05 -0500 Received: from mail-yb0-f193.google.com ([209.85.213.193]:34474 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753124AbcLBJXB (ORCPT ); Fri, 2 Dec 2016 04:23:01 -0500 MIME-Version: 1.0 In-Reply-To: <1476190256-1677-3-git-send-email-agruenba@redhat.com> References: <1476190256-1677-1-git-send-email-agruenba@redhat.com> <1476190256-1677-3-git-send-email-agruenba@redhat.com> From: Miklos Szeredi Date: Fri, 2 Dec 2016 10:22:58 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v27 02/21] vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags To: Andreas Gruenbacher Cc: Alexander Viro , Christoph Hellwig , "Theodore Ts'o" , Andreas Dilger , "J. Bruce Fields" , Jeff Layton , Trond Myklebust , Anna Schumaker , Dave Chinner , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, LKML , linux-fsdevel , linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-api@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 690 Lines: 17 On Tue, Oct 11, 2016 at 2:50 PM, Andreas Gruenbacher wrote: > Richacls distinguish between creating non-directories and directories. To > support that, add an isdir parameter to may_create(). When checking > inode_permission() for create permission, pass in an additional > MAY_CREATE_FILE or MAY_CREATE_DIR mask flag. > > Add may_replace() to allow checking for delete and create access when > replacing an existing file in vfs_rename(). That works for plain rename, but not for RENAME_EXCHANGE: is_dir and new_is_dir may be different, which means we can be deleting a non-directory *and* creating a directory in one dir and vice versa in the other. Thanks, Miklos