acl_compat.c revision 302408
11590Srgrimes/*-
21590Srgrimes * Copyright (c) 2008 Edward Tomasz Napiera��a <trasz@FreeBSD.org>
31590Srgrimes * All rights reserved.
41590Srgrimes *
51590Srgrimes * Redistribution and use in source and binary forms, with or without
61590Srgrimes * modification, are permitted provided that the following conditions
71590Srgrimes * are met:
81590Srgrimes * 1. Redistributions of source code must retain the above copyright
91590Srgrimes *    notice, this list of conditions and the following disclaimer.
101590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111590Srgrimes *    notice, this list of conditions and the following disclaimer in the
121590Srgrimes *    documentation and/or other materials provided with the distribution.
131590Srgrimes *
141590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
151590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
161590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
171590Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
181590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
191590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
201590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
211590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
221590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
231590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
241590Srgrimes * SUCH DAMAGE.
251590Srgrimes */
261590Srgrimes
271590Srgrimes#include <sys/cdefs.h>
281590Srgrimes__FBSDID("$FreeBSD: stable/11/lib/libc/posix1e/acl_compat.c 288027 2015-09-20 20:16:34Z rodrigc $");
291590Srgrimes
301590Srgrimes#include <sys/acl.h>
311590Srgrimes
321590Srgrimesint __oldacl_get_perm_np(acl_permset_t, oldacl_perm_t);
331590Srgrimesint __oldacl_add_perm(acl_permset_t, oldacl_perm_t);
341590Srgrimesint __oldacl_delete_perm(acl_permset_t, oldacl_perm_t);
351590Srgrimes
361590Srgrimes/*
371590Srgrimes * Compatibility wrappers for applications compiled against libc from before
381590Srgrimes * NFSv4 ACLs were added.
391590Srgrimes */
401590Srgrimesint
411590Srgrimes__oldacl_get_perm_np(acl_permset_t permset_d, oldacl_perm_t perm)
421590Srgrimes{
431590Srgrimes
441590Srgrimes	return (acl_get_perm_np(permset_d, perm));
451590Srgrimes}
461590Srgrimes
471590Srgrimesint
481590Srgrimes__oldacl_add_perm(acl_permset_t permset_d, oldacl_perm_t perm)
491590Srgrimes{
501590Srgrimes
511590Srgrimes	return (acl_add_perm(permset_d, perm));
521590Srgrimes}
531590Srgrimes
541590Srgrimesint
551590Srgrimes__oldacl_delete_perm(acl_permset_t permset_d, oldacl_perm_t perm)
561590Srgrimes{
571590Srgrimes
581590Srgrimes	return (acl_delete_perm(permset_d, perm));
591590Srgrimes}
601590Srgrimes
611590Srgrimes__sym_compat(acl_get_perm_np, __oldacl_get_perm_np, FBSD_1.0);
621590Srgrimes__sym_compat(acl_add_perm, __oldacl_add_perm, FBSD_1.0);
631590Srgrimes__sym_compat(acl_delete_perm, __oldacl_delete_perm, FBSD_1.0);
641590Srgrimes