acl_entry.c revision 75490
154359Sroberto/*
254359Sroberto * Copyright (c) 2001 Chris D. Faulhaber
354359Sroberto * All rights reserved.
454359Sroberto *
554359Sroberto * Redistribution and use in source and binary forms, with or without
654359Sroberto * modification, are permitted provided that the following conditions
754359Sroberto * are met:
854359Sroberto * 1. Redistributions of source code must retain the above copyright
954359Sroberto *    notice, this list of conditions and the following disclaimer.
1054359Sroberto * 2. Redistributions in binary form must reproduce the above copyright
1154359Sroberto *    notice, this list of conditions and the following disclaimer in the
1254359Sroberto *    documentation and/or other materials provided with the distribution.
1354359Sroberto *
1454359Sroberto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1554359Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1654359Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1754359Sroberto * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1854359Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1954359Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2054359Sroberto * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2154359Sroberto * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2254359Sroberto * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2354359Sroberto * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2454359Sroberto * SUCH DAMAGE.
2554359Sroberto *
2654359Sroberto * $FreeBSD: head/lib/libc/posix1e/acl_entry.c 75490 2001-04-13 19:14:38Z jedgar $
2754359Sroberto */
2854359Sroberto
2954359Sroberto#include <sys/types.h>
3054359Sroberto#include "namespace.h"
3154359Sroberto#include <sys/acl.h>
3254359Sroberto#include "un-namespace.h"
3382498Sroberto
3482498Sroberto#include <errno.h>
3582498Sroberto#include <stdlib.h>
3654359Sroberto
3754359Srobertoint
3854359Srobertoacl_create_entry(acl_t *acl_p, acl_entry_t *entry_p)
3954359Sroberto{
4054359Sroberto	acl_t acl;
4154359Sroberto
4254359Sroberto	if (!acl_p || !*acl_p || ((*acl_p)->acl_cnt >= ACL_MAX_ENTRIES) ||
4354359Sroberto	    ((*acl_p)->acl_cnt < 0)) {
4454359Sroberto		errno = EINVAL;
4554359Sroberto		return -1;
4654359Sroberto	}
4754359Sroberto
4854359Sroberto	acl = *acl_p;
4954359Sroberto
5054359Sroberto	*entry_p = &acl->acl_entry[acl->acl_cnt++];
5154359Sroberto
5254359Sroberto	(**entry_p).ae_tag  = ACL_UNDEFINED_TAG;
5354359Sroberto	(**entry_p).ae_id   = ACL_UNDEFINED_ID;
5454359Sroberto	(**entry_p).ae_perm = ACL_PERM_NONE;
55
56	return 0;
57}
58
59int
60acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p)
61{
62
63	errno = ENOSYS;
64	return -1;
65}
66