acl_get.c (75185) | acl_get.c (75492) |
---|---|
1/*- 2 * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/lib/libc/posix1e/acl_get.c 75185 2001-04-04 18:00:52Z tmm $ | 26 * $FreeBSD: head/lib/libc/posix1e/acl_get.c 75492 2001-04-13 19:37:04Z jedgar $ |
27 */ 28/* 29 * acl_get_file - syscall wrapper for retrieving ACL by filename 30 * acl_get_fd - syscall wrapper for retrieving access ACL by fd 31 * acl_get_fd_np - syscall wrapper for retrieving ACL by fd (non-POSIX) | 27 */ 28/* 29 * acl_get_file - syscall wrapper for retrieving ACL by filename 30 * acl_get_fd - syscall wrapper for retrieving access ACL by fd 31 * acl_get_fd_np - syscall wrapper for retrieving ACL by fd (non-POSIX) |
32 * acl_get_perm_np() checks if a permission is in the specified 33 * permset (non-POSIX) |
|
32 * acl_get_permset() returns the permission set in the ACL entry 33 * acl_get_qualifier() retrieves the qualifier of the tag from the ACL entry 34 * acl_get_tag_type() returns the tag type for the ACL entry entry_d 35 */ 36 37#include <sys/types.h> 38#include "namespace.h" 39#include <sys/acl.h> --- 59 unchanged lines hidden (view full) --- 99 acl_free(aclp); 100 return (NULL); 101 } 102 103 return (aclp); 104} 105 106int | 34 * acl_get_permset() returns the permission set in the ACL entry 35 * acl_get_qualifier() retrieves the qualifier of the tag from the ACL entry 36 * acl_get_tag_type() returns the tag type for the ACL entry entry_d 37 */ 38 39#include <sys/types.h> 40#include "namespace.h" 41#include <sys/acl.h> --- 59 unchanged lines hidden (view full) --- 101 acl_free(aclp); 102 return (NULL); 103 } 104 105 return (aclp); 106} 107 108int |
109acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) 110{ 111 112 switch(perm) { 113 case ACL_READ: 114 case ACL_WRITE: 115 case ACL_EXECUTE: 116 if (*permset_d & perm) 117 return 1; 118 break; 119 default: 120 errno = EINVAL; 121 return -1; 122 } 123 124 return 0; 125} 126 127int |
|
107acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p) 108{ 109 110 if (!entry_d || !permset_p) { 111 errno = EINVAL; 112 return -1; 113 } 114 --- 42 unchanged lines hidden --- | 128acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p) 129{ 130 131 if (!entry_d || !permset_p) { 132 errno = EINVAL; 133 return -1; 134 } 135 --- 42 unchanged lines hidden --- |