19ddb49cbSWarner Losh /*- 2c534fd78SRobert Watson * Copyright (c) 2001 Chris D. Faulhaber 3c534fd78SRobert Watson * All rights reserved. 4c534fd78SRobert Watson * 5c534fd78SRobert Watson * Redistribution and use in source and binary forms, with or without 6c534fd78SRobert Watson * modification, are permitted provided that the following conditions 7c534fd78SRobert Watson * are met: 8c534fd78SRobert Watson * 1. Redistributions of source code must retain the above copyright 9c534fd78SRobert Watson * notice, this list of conditions and the following disclaimer. 10c534fd78SRobert Watson * 2. Redistributions in binary form must reproduce the above copyright 11c534fd78SRobert Watson * notice, this list of conditions and the following disclaimer in the 12c534fd78SRobert Watson * documentation and/or other materials provided with the distribution. 13c534fd78SRobert Watson * 14c534fd78SRobert Watson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15c534fd78SRobert Watson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16c534fd78SRobert Watson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17a303eae7SJoel Dahl * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18a303eae7SJoel Dahl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19a303eae7SJoel Dahl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20a303eae7SJoel Dahl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21a303eae7SJoel Dahl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22a303eae7SJoel Dahl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23a303eae7SJoel Dahl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24a303eae7SJoel Dahl * SUCH DAMAGE. 25c534fd78SRobert Watson */ 26c534fd78SRobert Watson 27c534fd78SRobert Watson #ifndef _SETFACL_H 28c534fd78SRobert Watson #define _SETFACL_H 29c534fd78SRobert Watson 30b79f74ccSEd Maste #include <stdbool.h> 31b79f74ccSEd Maste 32c534fd78SRobert Watson #include <sys/types.h> 33c534fd78SRobert Watson #include <sys/acl.h> 34c534fd78SRobert Watson #include <sys/queue.h> 35c534fd78SRobert Watson 36c534fd78SRobert Watson /* files.c */ 37c534fd78SRobert Watson acl_t get_acl_from_file(const char *filename); 38c534fd78SRobert Watson /* merge.c */ 393f221878SEdward Tomasz Napierala int merge_acl(acl_t acl, acl_t *prev_acl, const char *filename); 40b79f74ccSEd Maste int add_acl(acl_t acl, uint entry_number, acl_t *prev_acl, 41b79f74ccSEd Maste const char *filename); 42c534fd78SRobert Watson /* remove.c */ 433f221878SEdward Tomasz Napierala int remove_acl(acl_t acl, acl_t *prev_acl, const char *filename); 44b79f74ccSEd Maste int remove_by_number(uint entry_number, acl_t *prev_acl, 45b79f74ccSEd Maste const char *filename); 463f221878SEdward Tomasz Napierala int remove_default(acl_t *prev_acl, const char *filename); 473f221878SEdward Tomasz Napierala void remove_ext(acl_t *prev_acl, const char *filename); 48c534fd78SRobert Watson /* mask.c */ 493f221878SEdward Tomasz Napierala int set_acl_mask(acl_t *prev_acl, const char *filename); 50c534fd78SRobert Watson /* util.c */ 51c534fd78SRobert Watson void *zmalloc(size_t size); 520629b152SEd Maste void *zrealloc(void *ptr, size_t size); 53c93b62deSEdward Tomasz Napierala const char *brand_name(int brand); 54c93b62deSEdward Tomasz Napierala int branding_mismatch(int brand1, int brand2); 55c534fd78SRobert Watson 56b79f74ccSEd Maste extern bool have_mask; 57b79f74ccSEd Maste extern bool have_stdin; 58b79f74ccSEd Maste extern bool n_flag; 59c534fd78SRobert Watson 60c534fd78SRobert Watson #endif /* _SETFACL_H */ 61