policy.h revision e02bc683670db294fbd983dc860f911ff8e7d1d2
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_POLICY_H
#define _SYS_POLICY_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#ifndef _IN_PORT_T
#define _IN_PORT_T
#endif
/*
* Policy routines; in case we check privileges in-line.
*
* priv_policy
* privilege debugging
* audits success & failure
* returns 0 on success, error on failure
*
* priv_policy_choice
* determines extend of operation
* audit on success
* returns a boolean_t indicating success (B_TRUE) or failure.
*
* priv_policy_only
* when auditing is in appropriate (interrupt context)
* to determine context of operation
* returns a boolean_t indicating success (B_TRUE) or failure.
*
*/
struct kipc_perm;
struct vfs;
struct proc;
struct priv_set;
int secpolicy_acct(const cred_t *);
int secpolicy_audit_config(const cred_t *);
int secpolicy_audit_getattr(const cred_t *);
int secpolicy_audit_modify(const cred_t *);
int secpolicy_blacklist(const cred_t *);
int secpolicy_chroot(const cred_t *);
int secpolicy_clock_highres(const cred_t *);
int secpolicy_console(const cred_t *);
int secpolicy_contract_identity(const cred_t *);
int secpolicy_contract_event(const cred_t *);
int secpolicy_coreadm(const cred_t *);
int secpolicy_cpc_cpu(const cred_t *);
int secpolicy_dispadm(const cred_t *);
int secpolicy_error_inject(const cred_t *);
int secpolicy_excl_open(const cred_t *);
int secpolicy_idmap(const cred_t *);
int secpolicy_dl_config(const cred_t *);
int secpolicy_ipc_config(const cred_t *);
int secpolicy_kmdb(const cred_t *);
int secpolicy_lock_memory(const cred_t *);
int secpolicy_modctl(const cred_t *, int);
int secpolicy_net_bindmlp(const cred_t *);
int secpolicy_net_icmpaccess(const cred_t *);
int secpolicy_net_mac_aware(const cred_t *);
int secpolicy_net_rawaccess(const cred_t *);
int secpolicy_newproc(const cred_t *);
int secpolicy_nfs(const cred_t *);
int secpolicy_pcfs_modify_bootpartition(const cred_t *);
int secpolicy_ponline(const cred_t *);
int secpolicy_pool(const cred_t *);
int secpolicy_power_mgmt(const cred_t *);
int secpolicy_ppp_config(const cred_t *);
int secpolicy_proc_access(const cred_t *);
int secpolicy_proc_excl_open(const cred_t *);
int secpolicy_proc_zone(const cred_t *);
int secpolicy_pset(const cred_t *);
int secpolicy_resource(const cred_t *);
int secpolicy_rpcmod_open(const cred_t *);
int secpolicy_setpriority(const cred_t *);
int secpolicy_settime(const cred_t *);
int secpolicy_smb(const cred_t *);
int secpolicy_sti(const cred_t *);
int secpolicy_swapctl(const cred_t *);
int secpolicy_zone_config(const cred_t *);
int secpolicy_sys_devices(const cred_t *);
int secpolicy_systeminfo(const cred_t *);
int secpolicy_tasksys(const cred_t *);
int secpolicy_vnode_create_gid(const cred_t *);
int secpolicy_vnode_remove(const cred_t *);
int secpolicy_vnode_stky_modify(const cred_t *);
int secpolicy_vscan(const cred_t *);
int secpolicy_zinject(const cred_t *);
int secpolicy_zfs(const cred_t *);
int secpolicy_ucode_update(const cred_t *);
int secpolicy_sadopen(const cred_t *);
int secpolicy_dld_ioctl(const cred_t *, const char *, const char *);
int secpolicy_xvm_control(const cred_t *);
int secpolicy_basic_fork(const cred_t *);
int secpolicy_basic_link(const cred_t *);
int secpolicy_basic_proc(const cred_t *);
int secpolicy_gart_access(const cred_t *);
int secpolicy_gart_map(const cred_t *);
/*
* This function to be called from xxfs_setattr().
* Must be called with the node's attributes read-write locked.
*
* cred_t * - acting credentials
* struct vnode * - vnode we're operating on
* struct vattr *va - new attributes, va_mask may be
* changed on return from a call
* struct vattr *oldva - old attributes, need include owner
* and mode only
* int flags - setattr flags
* int iaccess(void *node, int mode, cred_t *cr)
* - non-locking internal access function
* mode be checked
* w/ VREAD|VWRITE|VEXEC, not fs
* internal mode encoding.
*
* void *node - internal node (inode, tmpnode) to
* pass as arg to iaccess
*/
/*
* Test privilege. Audit success or failure, allow privilege debugging.
* Returns 0 for success, err for failure.
*/
/*
* Test privilege. Audit success only, no privilege debugging.
* Returns 1 for success, and 0 for failure.
*/
/*
* Test privilege. No priv_debugging, no auditing.
* Returns 1 for success, and 0 for failure.
*/
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_POLICY_H */