From: Christoph Hellwig Subject: [PATCH] remove posix_acl_masq_nfs_mode Date: Tue, 7 Sep 2004 16:34:50 +0200 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040907143450.GB8396@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from verein.lst.de ([213.95.11.210]:24729 "EHLO mail.lst.de") by vger.kernel.org with ESMTP id S268120AbUIGOe5 (ORCPT ); Tue, 7 Sep 2004 10:34:57 -0400 To: akpm@osdl.org, agruen@suse.de Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org completely unused but exported function in fs/posix_acl.c --- 1.1/fs/posix_acl.c 2002-10-31 08:27:40 +01:00 +++ edited/fs/posix_acl.c 2004-09-07 14:01:44 +02:00 @@ -29,7 +29,6 @@ EXPORT_SYMBOL(posix_acl_from_mode); EXPORT_SYMBOL(posix_acl_create_masq); EXPORT_SYMBOL(posix_acl_chmod_masq); -EXPORT_SYMBOL(posix_acl_masq_nfs_mode); EXPORT_SYMBOL(posix_acl_permission); /* @@ -377,47 +376,6 @@ return -EIO; group_obj->e_perm = (mode & S_IRWXG) >> 3; } - - return 0; -} - -/* - * Adjust the mode parameter so that NFSv2 grants nobody permissions - * that may not be granted by the ACL. This is necessary because NFSv2 - * may compute access permissions on the client side, and may serve cached - * data whenever it assumes access would be granted. Since ACLs may also - * be used to deny access to specific users, the minimal permissions - * for secure operation over NFSv2 are very restrictive. Permissions - * granted to users via Access Control Lists will not be effective over - * NFSv2. - * - * Privilege escalation can only happen for read operations, as writes are - * always carried out on the NFS server, where the proper access checks are - * implemented. - */ -int -posix_acl_masq_nfs_mode(struct posix_acl *acl, mode_t *mode_p) -{ - struct posix_acl_entry *pa, *pe; int min_perm = S_IRWXO; - - FOREACH_ACL_ENTRY(pa, acl, pe) { - switch(pa->e_tag) { - case ACL_USER_OBJ: - break; - - case ACL_USER: - case ACL_GROUP_OBJ: - case ACL_GROUP: - case ACL_MASK: - case ACL_OTHER: - min_perm &= pa->e_perm; - break; - - default: - return -EIO; - } - } - *mode_p = (*mode_p & ~(S_IRWXG|S_IRWXO)) | (min_perm << 3) | min_perm; return 0; } --- 1.1/include/linux/posix_acl.h 2002-10-31 08:27:40 +01:00 +++ edited/include/linux/posix_acl.h 2004-09-07 14:01:32 +02:00 @@ -79,7 +79,6 @@ extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); extern int posix_acl_create_masq(struct posix_acl *, mode_t *); extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); -extern int posix_acl_masq_nfs_mode(struct posix_acl *, mode_t *); extern struct posix_acl *get_posix_acl(struct inode *, int); extern int set_posix_acl(struct inode *, int, struct posix_acl *);