156055Srwatson/*- 274191Srwatson * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson 356055Srwatson * All rights reserved. 456055Srwatson * 556055Srwatson * Redistribution and use in source and binary forms, with or without 656055Srwatson * modification, are permitted provided that the following conditions 756055Srwatson * are met: 856055Srwatson * 1. Redistributions of source code must retain the above copyright 956055Srwatson * notice, this list of conditions and the following disclaimer. 1056055Srwatson * 2. Redistributions in binary form must reproduce the above copyright 1156055Srwatson * notice, this list of conditions and the following disclaimer in the 1256055Srwatson * documentation and/or other materials provided with the distribution. 1356055Srwatson * 1456055Srwatson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1556055Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1656055Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1756055Srwatson * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1856055Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1956055Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2056055Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2156055Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2256055Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2356055Srwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2456055Srwatson * SUCH DAMAGE. 2556055Srwatson * 2674191Srwatson * $FreeBSD$ 2756055Srwatson */ 2856055Srwatson/* 2956055Srwatson * Support functionality for the POSIX.1e ACL interface 3056055Srwatson * These calls are intended only to be called within the library. 3156055Srwatson */ 3256055Srwatson#ifndef _ACL_SUPPORT_H 3356055Srwatson#define _ACL_SUPPORT_H 3456055Srwatson 3574191Srwatson#define _POSIX1E_ACL_STRING_PERM_MAXSIZE 3 /* read, write, exec */ 36194955Strasz#define _ACL_T_ALIGNMENT_BITS 13 3756055Srwatson 38192586Straszint _acl_type_unold(acl_type_t type); 39194955Straszint _acl_differs(const acl_t a, const acl_t b); 40194955Straszint _acl_type_not_valid_for_acl(const acl_t acl, acl_type_t type); 41194955Straszvoid _acl_brand_from_type(acl_t acl, acl_type_t type); 42194955Straszint _acl_brand(const acl_t acl); 43194955Straszint _entry_brand(const acl_entry_t entry); 44194955Straszint _acl_brand_may_be(const acl_t acl, int brand); 45194955Straszint _entry_brand_may_be(const acl_entry_t entry, int brand); 46194955Straszvoid _acl_brand_as(acl_t acl, int brand); 47194955Straszvoid _entry_brand_as(const acl_entry_t entry, int brand); 48194955Straszint _nfs4_format_flags(char *str, size_t size, acl_flag_t var, int verbose); 49194955Straszint _nfs4_format_access_mask(char *str, size_t size, acl_perm_t var, int verbose); 50194955Straszint _nfs4_parse_flags(const char *str, acl_flag_t *var); 51194955Straszint _nfs4_parse_access_mask(const char *str, acl_perm_t *var); 5275928Sjedgarint _posix1e_acl_check(acl_t acl); 53208785Straszvoid _posix1e_acl_sort(acl_t acl); 5474191Srwatsonint _posix1e_acl(acl_t acl, acl_type_t type); 5574191Srwatsonint _posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, 56194955Strasz char *buf, int flags); 5774191Srwatsonint _posix1e_acl_perm_to_string(acl_perm_t perm, ssize_t buf_len, 5874191Srwatson char *buf); 5974191Srwatsonint _posix1e_acl_string_to_perm(char *string, acl_perm_t *perm); 6074191Srwatsonint _posix1e_acl_add_entry(acl_t acl, acl_tag_t tag, uid_t id, 6174191Srwatson acl_perm_t perm); 62194955Straszchar *string_skip_whitespace(char *string); 63194955Straszvoid string_trim_trailing_whitespace(char *string); 64209736Straszint _acl_name_to_id(acl_tag_t tag, char *name, uid_t *id); 6556055Srwatson 6656055Srwatson#endif 67