setfacl.h revision 74468
18870Srgrimes/*
250476Speter * Copyright (c) 2001 Chris D. Faulhaber
38870Srgrimes * All rights reserved.
42116Sjkh *
52116Sjkh * Redistribution and use in source and binary forms, with or without
68870Srgrimes * modification, are permitted provided that the following conditions
72116Sjkh * are met:
82116Sjkh * 1. Redistributions of source code must retain the above copyright
98870Srgrimes *    notice, this list of conditions and the following disclaimer.
102116Sjkh * 2. Redistributions in binary form must reproduce the above copyright
112116Sjkh *    notice, this list of conditions and the following disclaimer in the
128870Srgrimes *    documentation and/or other materials provided with the distribution.
138870Srgrimes *
142116Sjkh * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
152116Sjkh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
162116Sjkh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
172116Sjkh * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE
188870Srgrimes * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
198870Srgrimes * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
202116Sjkh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
212116Sjkh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
222116Sjkh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
232116Sjkh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
242116Sjkh * POSSIBILITY OF SUCH DAMAGE.
252116Sjkh *
268870Srgrimes * $FreeBSD: head/bin/setfacl/setfacl.h 74468 2001-03-19 18:59:36Z rwatson $
272116Sjkh */
282116Sjkh
292116Sjkh#ifndef _SETFACL_H
302116Sjkh#define _SETFACL_H
318870Srgrimes
322116Sjkh#include <sys/types.h>
332116Sjkh#include <sys/acl.h>
348870Srgrimes#include <sys/queue.h>
352116Sjkh
362116Sjkh/* file operations */
378870Srgrimes#define	OP_MERGE_ACL		0x00	/* merge acl's (-mM) */
382116Sjkh#define	OP_REMOVE_DEF		0x01	/* remove default acl's (-k) */
392116Sjkh#define	OP_REMOVE_EXT		0x02	/* remove extended acl's (-b) */
408870Srgrimes#define	OP_REMOVE_ACL		0x03	/* remove acl's (-xX) */
412116Sjkh
428870Srgrimes/* STAILQ entry for acl operations */
432116Sjkhstruct sf_entry {
4433662Sjb	uint	op;
4533662Sjb	acl_t	acl;
4633662Sjb	STAILQ_ENTRY(sf_entry) next;
4733662Sjb};
4833662SjbSTAILQ_HEAD(, sf_entry) entrylist;
4933662Sjb
5033662Sjb/* STAILQ entry for files */
5142044Sdfrstruct sf_file {
5242044Sdfr	const char *filename;
5333662Sjb	STAILQ_ENTRY(sf_file) next;
5422808Sbde};
5524964SbdeSTAILQ_HEAD(, sf_file) filelist;
562116Sjkh
572116Sjkh/* files.c */
5822731Sbdeacl_t  get_acl_from_file(const char *filename);
592116Sjkh/* merge.c */
6033662Sjbint    merge_acl(acl_t acl, acl_t *prev_acl);
6133662Sjb/* remove.c */
6233662Sjbint    remove_acl(acl_t acl, acl_t *prev_acl);
6333662Sjbint    remove_default(acl_t *prev_acl);
6433662Sjbvoid   remove_ext(acl_t *prev_acl);
6533662Sjb/* mask.c */
6633662Sjbint    set_acl_mask(acl_t prev_acl);
672116Sjkh/* util.c */
6822731Sbdevoid  *zmalloc(size_t size);
6922731Sbde
7022731Sbdeacl_type_t acl_type;
712116Sjkhuint       have_mask;
722116Sjkhuint       need_mask;
732116Sjkhuint       have_stdin;
7424964Sbdeuint       n_flag;
752116Sjkh
762116Sjkh#endif /* _SETFACL_H */
772116Sjkh