1eda14cbcSMatt Macy /*
2eda14cbcSMatt Macy  * CDDL HEADER START
3eda14cbcSMatt Macy  *
4eda14cbcSMatt Macy  * The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy  * Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy  * You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy  *
8eda14cbcSMatt Macy  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9271171e0SMartin Matuska  * or https://opensource.org/licenses/CDDL-1.0.
10eda14cbcSMatt Macy  * See the License for the specific language governing permissions
11eda14cbcSMatt Macy  * and limitations under the License.
12eda14cbcSMatt Macy  *
13eda14cbcSMatt Macy  * When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy  * If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy  * fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy  * information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy  *
19eda14cbcSMatt Macy  * CDDL HEADER END
20eda14cbcSMatt Macy  */
21eda14cbcSMatt Macy 
22eda14cbcSMatt Macy /*
23eda14cbcSMatt Macy  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24eda14cbcSMatt Macy  * Copyright 2015, Joyent, Inc. All rights reserved.
25eda14cbcSMatt Macy  * Copyright (c) 2016, Lawrence Livermore National Security, LLC.
26eda14cbcSMatt Macy  */
27eda14cbcSMatt Macy 
28eda14cbcSMatt Macy #ifndef _SYS_POLICY_H
29eda14cbcSMatt Macy #define	_SYS_POLICY_H
30eda14cbcSMatt Macy 
31eda14cbcSMatt Macy #ifdef _KERNEL
32eda14cbcSMatt Macy 
33eda14cbcSMatt Macy #include <sys/cred.h>
34eda14cbcSMatt Macy #include <sys/types.h>
35eda14cbcSMatt Macy #include <sys/xvattr.h>
36eda14cbcSMatt Macy #include <sys/zpl.h>
37eda14cbcSMatt Macy 
387877fdebSMatt Macy struct znode;
397877fdebSMatt Macy 
40eda14cbcSMatt Macy int secpolicy_nfs(const cred_t *);
41eda14cbcSMatt Macy int secpolicy_sys_config(const cred_t *, boolean_t);
42eda14cbcSMatt Macy int secpolicy_vnode_access2(const cred_t *, struct inode *,
43eda14cbcSMatt Macy     uid_t, mode_t, mode_t);
44eda14cbcSMatt Macy int secpolicy_vnode_any_access(const cred_t *, struct inode *, uid_t);
45eda14cbcSMatt Macy int secpolicy_vnode_chown(const cred_t *, uid_t);
46eda14cbcSMatt Macy int secpolicy_vnode_create_gid(const cred_t *);
47eda14cbcSMatt Macy int secpolicy_vnode_remove(const cred_t *);
48eda14cbcSMatt Macy int secpolicy_vnode_setdac(const cred_t *, uid_t);
497877fdebSMatt Macy int secpolicy_vnode_setid_retain(struct znode *, const cred_t *, boolean_t);
50d411c1d6SMartin Matuska int secpolicy_vnode_setids_setgids(const cred_t *, gid_t, zidmap_t *,
51d411c1d6SMartin Matuska     struct user_namespace *);
52eda14cbcSMatt Macy int secpolicy_zinject(const cred_t *);
53eda14cbcSMatt Macy int secpolicy_zfs(const cred_t *);
54eda14cbcSMatt Macy int secpolicy_zfs_proc(const cred_t *, proc_t *);
55eda14cbcSMatt Macy void secpolicy_setid_clear(vattr_t *, cred_t *);
56eda14cbcSMatt Macy int secpolicy_setid_setsticky_clear(struct inode *, vattr_t *,
57d411c1d6SMartin Matuska     const vattr_t *, cred_t *, zidmap_t *, struct user_namespace *);
58eda14cbcSMatt Macy int secpolicy_xvattr(xvattr_t *, uid_t, cred_t *, mode_t);
59eda14cbcSMatt Macy int secpolicy_vnode_setattr(cred_t *, struct inode *, struct vattr *,
60eda14cbcSMatt Macy     const struct vattr *, int, int (void *, int, cred_t *), void *);
61eda14cbcSMatt Macy int secpolicy_basic_link(const cred_t *);
62eda14cbcSMatt Macy 
63eda14cbcSMatt Macy #endif /* _KERNEL */
64eda14cbcSMatt Macy #endif /* _SYS_POLICY_H */
65