/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2001-2002 Chris D. Faulhaber4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#include <sys/types.h>29#include "namespace.h"30#include <sys/acl.h>31#include "un-namespace.h"3233#include <errno.h>34#include <string.h>3536#include "acl_support.h"3738/*39* acl_copy_entry() (23.4.4): copy the contents of ACL entry src_d to40* ACL entry dest_d41*/42int43acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d)44{4546if (src_d == NULL || dest_d == NULL || src_d == dest_d) {47errno = EINVAL;48return (-1);49}5051/*52* Can we brand the new entry the same as the source entry?53*/54if (!_entry_brand_may_be(dest_d, _entry_brand(src_d))) {55errno = EINVAL;56return (-1);57}5859_entry_brand_as(dest_d, _entry_brand(src_d));6061dest_d->ae_tag = src_d->ae_tag;62dest_d->ae_id = src_d->ae_id;63dest_d->ae_perm = src_d->ae_perm;64dest_d->ae_entry_type = src_d->ae_entry_type;65dest_d->ae_flags = src_d->ae_flags;6667return (0);68}6970ssize_t71acl_copy_ext(void *buf_p, acl_t acl, ssize_t size)72{7374errno = ENOSYS;75return (-1);76}7778acl_t79acl_copy_int(const void *buf_p)80{8182errno = ENOSYS;83return (NULL);84}858687