xref: /freebsd/lib/libc/posix1e/acl_compat.c (revision 559a218c9b257775fb249b67945fe4a05b7a6b9f)
1ae1add4eSEdward Tomasz Napierala /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3d915a14eSPedro F. Giffuni  *
4ae1add4eSEdward Tomasz Napierala  * Copyright (c) 2008 Edward Tomasz Napierała <trasz@FreeBSD.org>
5ae1add4eSEdward Tomasz Napierala  *
6ae1add4eSEdward Tomasz Napierala  * Redistribution and use in source and binary forms, with or without
7ae1add4eSEdward Tomasz Napierala  * modification, are permitted provided that the following conditions
8ae1add4eSEdward Tomasz Napierala  * are met:
9ae1add4eSEdward Tomasz Napierala  * 1. Redistributions of source code must retain the above copyright
10ae1add4eSEdward Tomasz Napierala  *    notice, this list of conditions and the following disclaimer.
11ae1add4eSEdward Tomasz Napierala  * 2. Redistributions in binary form must reproduce the above copyright
12ae1add4eSEdward Tomasz Napierala  *    notice, this list of conditions and the following disclaimer in the
13ae1add4eSEdward Tomasz Napierala  *    documentation and/or other materials provided with the distribution.
14ae1add4eSEdward Tomasz Napierala  *
15b7014134SEdward Tomasz Napierala  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16b7014134SEdward Tomasz Napierala  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17b7014134SEdward Tomasz Napierala  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18b7014134SEdward Tomasz Napierala  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19b7014134SEdward Tomasz Napierala  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20b7014134SEdward Tomasz Napierala  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21b7014134SEdward Tomasz Napierala  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22b7014134SEdward Tomasz Napierala  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23b7014134SEdward Tomasz Napierala  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24b7014134SEdward Tomasz Napierala  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25b7014134SEdward Tomasz Napierala  * SUCH DAMAGE.
26ae1add4eSEdward Tomasz Napierala  */
27ae1add4eSEdward Tomasz Napierala 
28ae1add4eSEdward Tomasz Napierala #include <sys/acl.h>
29ae1add4eSEdward Tomasz Napierala 
308d7e1f15SCraig Rodrigues int __oldacl_get_perm_np(acl_permset_t, oldacl_perm_t);
318d7e1f15SCraig Rodrigues int __oldacl_add_perm(acl_permset_t, oldacl_perm_t);
328d7e1f15SCraig Rodrigues int __oldacl_delete_perm(acl_permset_t, oldacl_perm_t);
339762525cSCraig Rodrigues 
34ae1add4eSEdward Tomasz Napierala /*
35ae1add4eSEdward Tomasz Napierala  * Compatibility wrappers for applications compiled against libc from before
36ae1add4eSEdward Tomasz Napierala  * NFSv4 ACLs were added.
37ae1add4eSEdward Tomasz Napierala  */
38ae1add4eSEdward Tomasz Napierala int
__oldacl_get_perm_np(acl_permset_t permset_d,oldacl_perm_t perm)39ae1add4eSEdward Tomasz Napierala __oldacl_get_perm_np(acl_permset_t permset_d, oldacl_perm_t perm)
40ae1add4eSEdward Tomasz Napierala {
41ae1add4eSEdward Tomasz Napierala 
42ae1add4eSEdward Tomasz Napierala 	return (acl_get_perm_np(permset_d, perm));
43ae1add4eSEdward Tomasz Napierala }
44ae1add4eSEdward Tomasz Napierala 
45ae1add4eSEdward Tomasz Napierala int
__oldacl_add_perm(acl_permset_t permset_d,oldacl_perm_t perm)46ae1add4eSEdward Tomasz Napierala __oldacl_add_perm(acl_permset_t permset_d, oldacl_perm_t perm)
47ae1add4eSEdward Tomasz Napierala {
48ae1add4eSEdward Tomasz Napierala 
49ae1add4eSEdward Tomasz Napierala 	return (acl_add_perm(permset_d, perm));
50ae1add4eSEdward Tomasz Napierala }
51ae1add4eSEdward Tomasz Napierala 
52ae1add4eSEdward Tomasz Napierala int
__oldacl_delete_perm(acl_permset_t permset_d,oldacl_perm_t perm)53ae1add4eSEdward Tomasz Napierala __oldacl_delete_perm(acl_permset_t permset_d, oldacl_perm_t perm)
54ae1add4eSEdward Tomasz Napierala {
55ae1add4eSEdward Tomasz Napierala 
56ae1add4eSEdward Tomasz Napierala 	return (acl_delete_perm(permset_d, perm));
57ae1add4eSEdward Tomasz Napierala }
58ae1add4eSEdward Tomasz Napierala 
59ae1add4eSEdward Tomasz Napierala __sym_compat(acl_get_perm_np, __oldacl_get_perm_np, FBSD_1.0);
60ae1add4eSEdward Tomasz Napierala __sym_compat(acl_add_perm, __oldacl_add_perm, FBSD_1.0);
61ae1add4eSEdward Tomasz Napierala __sym_compat(acl_delete_perm, __oldacl_delete_perm, FBSD_1.0);
62