From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 2 20:35:56 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 627781065672; Wed, 2 Jun 2010 20:35:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 511EF8FC14; Wed, 2 Jun 2010 20:35:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o52KZuso061637; Wed, 2 Jun 2010 20:35:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o52KZuhm061634; Wed, 2 Jun 2010 20:35:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006022035.o52KZuhm061634@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 2 Jun 2010 20:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208756 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 20:35:56 -0000 Author: trasz Date: Wed Jun 2 20:35:56 2010 New Revision: 208756 URL: http://svn.freebsd.org/changeset/base/208756 Log: MFC r208437: Make acl_get_perm_np(3) work with NFSv4 ACLs. Reviewed by: kientzle@ Approved by: re (kib) Modified: stable/8/lib/libc/posix1e/acl_get.c stable/8/lib/libc/posix1e/acl_perm.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/posix1e/acl_get.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_get.c Wed Jun 2 19:16:58 2010 (r208755) +++ stable/8/lib/libc/posix1e/acl_get.c Wed Jun 2 20:35:56 2010 (r208756) @@ -132,30 +132,6 @@ acl_get_fd_np(int fd, acl_type_t type) return (aclp); } -int -acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) -{ - - if (permset_d == NULL) { - errno = EINVAL; - return (-1); - } - - switch(perm) { - case ACL_READ: - case ACL_WRITE: - case ACL_EXECUTE: - if (*permset_d & perm) - return (1); - break; - default: - errno = EINVAL; - return (-1); - } - - return (0); -} - /* * acl_get_permset() (23.4.17): return via permset_p a descriptor to * the permission set in the ACL entry entry_d. Modified: stable/8/lib/libc/posix1e/acl_perm.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_perm.c Wed Jun 2 19:16:58 2010 (r208755) +++ stable/8/lib/libc/posix1e/acl_perm.c Wed Jun 2 20:35:56 2010 (r208756) @@ -108,3 +108,21 @@ acl_delete_perm(acl_permset_t permset_d, return (0); } + +int +acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) +{ + + if (permset_d == NULL) { + errno = EINVAL; + return (-1); + } + + if (_perm_is_invalid(perm)) + return (-1); + + if (*permset_d & perm) + return (1); + + return (0); +}