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