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