xref: /freebsd/lib/libc/posix1e/mac_set.c (revision 559a218c9b257775fb249b67945fe4a05b7a6b9f)
1*d915a14eSPedro F. Giffuni /*-
2*d915a14eSPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*d915a14eSPedro F. Giffuni  *
4d97fcfceSRobert Watson  * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
5d97fcfceSRobert Watson  * All rights reserved.
6d97fcfceSRobert Watson  *
7d97fcfceSRobert Watson  * This software was developed by Robert Watson for the TrustedBSD Project.
8d97fcfceSRobert Watson  *
9d97fcfceSRobert Watson  * Redistribution and use in source and binary forms, with or without
10d97fcfceSRobert Watson  * modification, are permitted provided that the following conditions
11d97fcfceSRobert Watson  * are met:
12d97fcfceSRobert Watson  * 1. Redistributions of source code must retain the above copyright
13d97fcfceSRobert Watson  *    notice, this list of conditions and the following disclaimer.
14d97fcfceSRobert Watson  * 2. Redistributions in binary form must reproduce the above copyright
15d97fcfceSRobert Watson  *    notice, this list of conditions and the following disclaimer in the
16d97fcfceSRobert Watson  *    documentation and/or other materials provided with the distribution.
17d97fcfceSRobert Watson  * 3. The names of the authors may not be used to endorse or promote
18d97fcfceSRobert Watson  *    products derived from this software without specific prior written
19d97fcfceSRobert Watson  *    permission.
20d97fcfceSRobert Watson  *
21d97fcfceSRobert Watson  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22d97fcfceSRobert Watson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23d97fcfceSRobert Watson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24d97fcfceSRobert Watson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25d97fcfceSRobert Watson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26d97fcfceSRobert Watson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27d97fcfceSRobert Watson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28d97fcfceSRobert Watson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29d97fcfceSRobert Watson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30d97fcfceSRobert Watson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31d97fcfceSRobert Watson  * SUCH DAMAGE.
32d97fcfceSRobert Watson  */
33d97fcfceSRobert Watson 
34d97fcfceSRobert Watson #include <sys/types.h>
35d97fcfceSRobert Watson #include <sys/mac.h>
36d97fcfceSRobert Watson 
372bbd7cf8SJacques Vidrine extern	int	__mac_set_fd(int fd, struct mac *mac_p);
382bbd7cf8SJacques Vidrine extern	int	__mac_set_file(const char *path_p, struct mac *mac_p);
392bbd7cf8SJacques Vidrine extern	int	__mac_set_link(const char *path_p, struct mac *mac_p);
402bbd7cf8SJacques Vidrine extern	int	__mac_set_proc(struct mac *mac_p);
412bbd7cf8SJacques Vidrine 
42d97fcfceSRobert Watson int
mac_set_fd(int fd,struct mac * label)43391b1d75SRobert Watson mac_set_fd(int fd, struct mac *label)
44d97fcfceSRobert Watson {
45d97fcfceSRobert Watson 
46d97fcfceSRobert Watson 	return (__mac_set_fd(fd, label));
47d97fcfceSRobert Watson }
48d97fcfceSRobert Watson 
49d97fcfceSRobert Watson int
mac_set_file(const char * path,struct mac * label)50391b1d75SRobert Watson mac_set_file(const char *path, struct mac *label)
51391b1d75SRobert Watson {
52391b1d75SRobert Watson 
53391b1d75SRobert Watson 	return (__mac_set_file(path, label));
54391b1d75SRobert Watson }
55391b1d75SRobert Watson 
56391b1d75SRobert Watson int
mac_set_link(const char * path,struct mac * label)57391b1d75SRobert Watson mac_set_link(const char *path, struct mac *label)
58391b1d75SRobert Watson {
59391b1d75SRobert Watson 
60391b1d75SRobert Watson 	return (__mac_set_link(path, label));
61391b1d75SRobert Watson }
62391b1d75SRobert Watson 
63391b1d75SRobert Watson int
mac_set_proc(struct mac * label)64391b1d75SRobert Watson mac_set_proc(struct mac *label)
65d97fcfceSRobert Watson {
66d97fcfceSRobert Watson 
67d97fcfceSRobert Watson 	return (__mac_set_proc(label));
68d97fcfceSRobert Watson }
69