acl_copy.c revision 90781
174667Sjedgar/*
290781Sjedgar * Copyright (c) 2001-2002 Chris D. Faulhaber
374667Sjedgar * All rights reserved.
474667Sjedgar *
574667Sjedgar * Redistribution and use in source and binary forms, with or without
674667Sjedgar * modification, are permitted provided that the following conditions
774667Sjedgar * are met:
874667Sjedgar * 1. Redistributions of source code must retain the above copyright
974667Sjedgar *    notice, this list of conditions and the following disclaimer.
1074667Sjedgar * 2. Redistributions in binary form must reproduce the above copyright
1174667Sjedgar *    notice, this list of conditions and the following disclaimer in the
1274667Sjedgar *    documentation and/or other materials provided with the distribution.
1374667Sjedgar *
1474667Sjedgar * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1574667Sjedgar * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1674667Sjedgar * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1774667Sjedgar * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE
1874667Sjedgar * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1974667Sjedgar * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2074667Sjedgar * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2174667Sjedgar * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2274667Sjedgar * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2374667Sjedgar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2474667Sjedgar * POSSIBILITY OF SUCH DAMAGE.
2574667Sjedgar *
2674667Sjedgar * $FreeBSD: head/lib/libc/posix1e/acl_copy.c 90781 2002-02-17 20:05:20Z jedgar $
2774667Sjedgar */
2874667Sjedgar
2974667Sjedgar#include <sys/types.h>
3075185Stmm#include "namespace.h"
3174667Sjedgar#include <sys/acl.h>
3275185Stmm#include "un-namespace.h"
3374667Sjedgar
3474667Sjedgar#include <errno.h>
3574667Sjedgar#include <string.h>
3674667Sjedgar
3774667Sjedgar/*
3875928Sjedgar * acl_copy_entry() (23.4.4): copy the contents of ACL entry src_d to
3974667Sjedgar * ACL entry dest_d
4074667Sjedgar */
4174667Sjedgarint
4274667Sjedgaracl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d)
4374667Sjedgar{
4474667Sjedgar
4590781Sjedgar	if (src_d == NULL || dest_d == NULL || src_d == dest_d) {
4674667Sjedgar		errno = EINVAL;
4790781Sjedgar		return (-1);
4874667Sjedgar	}
4974667Sjedgar
5074667Sjedgar	dest_d->ae_tag  = src_d->ae_tag;
5174667Sjedgar	dest_d->ae_id   = src_d->ae_id;
5274667Sjedgar	dest_d->ae_perm = src_d->ae_perm;
5374667Sjedgar
5490781Sjedgar	return (0);
5574667Sjedgar}
5674667Sjedgar
5774667Sjedgarssize_t
5874667Sjedgaracl_copy_ext(void *buf_p, acl_t acl, ssize_t size)
5974667Sjedgar{
6074667Sjedgar
6174667Sjedgar	errno = ENOSYS;
6290781Sjedgar	return (-1);
6374667Sjedgar}
6474667Sjedgar
6574667Sjedgaracl_t
6674667Sjedgaracl_copy_int(const void *buf_p)
6774667Sjedgar{
6874667Sjedgar
6974667Sjedgar	errno = ENOSYS;
7090781Sjedgar	return (NULL);
7174667Sjedgar}
72