| /* automatically generated by rust-bindgen 0.70.1 */ |
| |
| pub const SELINUX_AVD_FLAGS_PERMISSIVE: i32 = 1; |
| pub const SELINUX_CB_LOG: i32 = 0; |
| pub const SELINUX_CB_AUDIT: i32 = 1; |
| pub const SELINUX_CB_VALIDATE: i32 = 2; |
| pub const SELINUX_CB_SETENFORCE: i32 = 3; |
| pub const SELINUX_CB_POLICYLOAD: i32 = 4; |
| pub const SELINUX_ERROR: i32 = 0; |
| pub const SELINUX_WARNING: i32 = 1; |
| pub const SELINUX_INFO: i32 = 2; |
| pub const SELINUX_AVC: i32 = 3; |
| pub const SELINUX_POLICYLOAD: i32 = 4; |
| pub const SELINUX_SETENFORCE: i32 = 5; |
| pub const SELINUX_TRANS_DIR: &[u8; 17] = b"/var/run/setrans\0"; |
| pub const MATCHPATHCON_BASEONLY: i32 = 1; |
| pub const MATCHPATHCON_NOTRANS: i32 = 2; |
| pub const MATCHPATHCON_VALIDATE: i32 = 4; |
| pub const AVC_OPT_UNUSED: i32 = 0; |
| pub const AVC_OPT_SETENFORCE: i32 = 1; |
| pub const AVC_CALLBACK_GRANT: i32 = 1; |
| pub const AVC_CALLBACK_TRY_REVOKE: i32 = 2; |
| pub const AVC_CALLBACK_REVOKE: i32 = 4; |
| pub const AVC_CALLBACK_RESET: i32 = 8; |
| pub const AVC_CALLBACK_AUDITALLOW_ENABLE: i32 = 16; |
| pub const AVC_CALLBACK_AUDITALLOW_DISABLE: i32 = 32; |
| pub const AVC_CALLBACK_AUDITDENY_ENABLE: i32 = 64; |
| pub const AVC_CALLBACK_AUDITDENY_DISABLE: i32 = 128; |
| pub const AVC_CACHE_STATS: i32 = 1; |
| pub const SELABEL_CTX_FILE: i32 = 0; |
| pub const SELABEL_CTX_MEDIA: i32 = 1; |
| pub const SELABEL_CTX_X: i32 = 2; |
| pub const SELABEL_CTX_DB: i32 = 3; |
| pub const SELABEL_CTX_ANDROID_PROP: i32 = 4; |
| pub const SELABEL_CTX_ANDROID_SERVICE: i32 = 5; |
| pub const SELABEL_OPT_UNUSED: i32 = 0; |
| pub const SELABEL_OPT_VALIDATE: i32 = 1; |
| pub const SELABEL_OPT_BASEONLY: i32 = 2; |
| pub const SELABEL_OPT_PATH: i32 = 3; |
| pub const SELABEL_OPT_SUBSET: i32 = 4; |
| pub const SELABEL_OPT_DIGEST: i32 = 5; |
| pub const SELABEL_NOPT: i32 = 6; |
| pub const SELABEL_X_PROP: i32 = 1; |
| pub const SELABEL_X_EXT: i32 = 2; |
| pub const SELABEL_X_CLIENT: i32 = 3; |
| pub const SELABEL_X_EVENT: i32 = 4; |
| pub const SELABEL_X_SELN: i32 = 5; |
| pub const SELABEL_X_POLYPROP: i32 = 6; |
| pub const SELABEL_X_POLYSELN: i32 = 7; |
| pub const SELABEL_DB_DATABASE: i32 = 1; |
| pub const SELABEL_DB_SCHEMA: i32 = 2; |
| pub const SELABEL_DB_TABLE: i32 = 3; |
| pub const SELABEL_DB_COLUMN: i32 = 4; |
| pub const SELABEL_DB_SEQUENCE: i32 = 5; |
| pub const SELABEL_DB_VIEW: i32 = 6; |
| pub const SELABEL_DB_PROCEDURE: i32 = 7; |
| pub const SELABEL_DB_BLOB: i32 = 8; |
| pub const SELABEL_DB_TUPLE: i32 = 9; |
| pub const SELABEL_DB_LANGUAGE: i32 = 10; |
| pub const SELABEL_DB_EXCEPTION: i32 = 11; |
| pub const SELABEL_DB_DATATYPE: i32 = 12; |
| pub const SELINUX_RESTORECON_IGNORE_DIGEST: i32 = 1; |
| pub const SELINUX_RESTORECON_NOCHANGE: i32 = 2; |
| pub const SELINUX_RESTORECON_SET_SPECFILE_CTX: i32 = 4; |
| pub const SELINUX_RESTORECON_RECURSE: i32 = 8; |
| pub const SELINUX_RESTORECON_VERBOSE: i32 = 16; |
| pub const SELINUX_RESTORECON_PROGRESS: i32 = 32; |
| pub const SELINUX_RESTORECON_REALPATH: i32 = 64; |
| pub const SELINUX_RESTORECON_XDEV: i32 = 128; |
| pub const SELINUX_RESTORECON_ADD_ASSOC: i32 = 256; |
| pub const SELINUX_RESTORECON_ABORT_ON_ERROR: i32 = 512; |
| pub const SELINUX_RESTORECON_SYSLOG_CHANGES: i32 = 1024; |
| pub const SELINUX_RESTORECON_LOG_MATCHES: i32 = 2048; |
| pub const SELINUX_RESTORECON_IGNORE_NOENTRY: i32 = 4096; |
| pub const SELINUX_RESTORECON_IGNORE_MOUNTS: i32 = 8192; |
| pub const SELINUX_RESTORECON_MASS_RELABEL: i32 = 16384; |
| pub const SELINUX_RESTORECON_SKIP_DIGEST: i32 = 32768; |
| pub const SELINUX_RESTORECON_CONFLICT_ERROR: i32 = 65536; |
| pub const SELINUX_RESTORECON_COUNT_ERRORS: i32 = 131072; |
| pub const SELINUX_RESTORECON_XATTR_RECURSE: i32 = 1; |
| pub const SELINUX_RESTORECON_XATTR_DELETE_NONMATCH_DIGESTS: i32 = 2; |
| pub const SELINUX_RESTORECON_XATTR_DELETE_ALL_DIGESTS: i32 = 4; |
| pub const SELINUX_RESTORECON_XATTR_IGNORE_MOUNTS: i32 = 8; |
| pub const SELINUX_DEFAULTUSER: &[u8; 7] = b"user_u\0"; |
| pub type __ino_t = ::std::os::raw::c_ulong; |
| pub type __mode_t = ::std::os::raw::c_uint; |
| pub type __pid_t = ::std::os::raw::c_int; |
| pub type ino_t = __ino_t; |
| pub type mode_t = __mode_t; |
| pub type pid_t = __pid_t; |
| extern "C" { |
| pub fn is_selinux_enabled() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn is_selinux_mls_enabled() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn freecon(con: *mut ::std::os::raw::c_char); |
| } |
| extern "C" { |
| pub fn freeconary(con: *mut *mut ::std::os::raw::c_char); |
| } |
| extern "C" { |
| pub fn getcon(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getcon_raw(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setcon(con: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setcon_raw(con: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getpidcon(pid: pid_t, con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getpidcon_raw( |
| pid: pid_t, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getprevcon(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getprevcon_raw(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getexeccon(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getexeccon_raw(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setexeccon(con: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setexeccon_raw(con: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getfscreatecon(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getfscreatecon_raw(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setfscreatecon(context: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setfscreatecon_raw(context: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getkeycreatecon(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getkeycreatecon_raw(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setkeycreatecon(context: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setkeycreatecon_raw(context: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getsockcreatecon(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getsockcreatecon_raw(con: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setsockcreatecon(context: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setsockcreatecon_raw(context: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getfilecon( |
| path: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getfilecon_raw( |
| path: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn lgetfilecon( |
| path: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn lgetfilecon_raw( |
| path: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn fgetfilecon( |
| fd: ::std::os::raw::c_int, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn fgetfilecon_raw( |
| fd: ::std::os::raw::c_int, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setfilecon( |
| path: *const ::std::os::raw::c_char, |
| con: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn setfilecon_raw( |
| path: *const ::std::os::raw::c_char, |
| con: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn lsetfilecon( |
| path: *const ::std::os::raw::c_char, |
| con: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn lsetfilecon_raw( |
| path: *const ::std::os::raw::c_char, |
| con: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn fsetfilecon( |
| fd: ::std::os::raw::c_int, |
| con: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn fsetfilecon_raw( |
| fd: ::std::os::raw::c_int, |
| con: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getpeercon( |
| fd: ::std::os::raw::c_int, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getpeercon_raw( |
| fd: ::std::os::raw::c_int, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| pub type access_vector_t = ::std::os::raw::c_uint; |
| pub type security_class_t = ::std::os::raw::c_ushort; |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct av_decision { |
| pub allowed: access_vector_t, |
| pub decided: access_vector_t, |
| pub auditallow: access_vector_t, |
| pub auditdeny: access_vector_t, |
| pub seqno: ::std::os::raw::c_uint, |
| pub flags: ::std::os::raw::c_uint, |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct selinux_opt { |
| pub type_: ::std::os::raw::c_int, |
| pub value: *const ::std::os::raw::c_char, |
| } |
| #[repr(C)] |
| #[derive(Copy, Clone)] |
| pub union selinux_callback { |
| pub func_log: ::std::option::Option< |
| unsafe extern "C" fn( |
| type_: ::std::os::raw::c_int, |
| fmt: *const ::std::os::raw::c_char, |
| ... |
| ) -> ::std::os::raw::c_int, |
| >, |
| pub func_audit: ::std::option::Option< |
| unsafe extern "C" fn( |
| auditdata: *mut ::std::os::raw::c_void, |
| cls: security_class_t, |
| msgbuf: *mut ::std::os::raw::c_char, |
| msgbufsize: usize, |
| ) -> ::std::os::raw::c_int, |
| >, |
| pub func_validate: ::std::option::Option< |
| unsafe extern "C" fn(ctx: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int, |
| >, |
| pub func_setenforce: ::std::option::Option< |
| unsafe extern "C" fn(enforcing: ::std::os::raw::c_int) -> ::std::os::raw::c_int, |
| >, |
| pub func_policyload: ::std::option::Option< |
| unsafe extern "C" fn(seqno: ::std::os::raw::c_int) -> ::std::os::raw::c_int, |
| >, |
| } |
| impl ::std::fmt::Debug for selinux_callback { |
| fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
| write!(f, "selinux_callback {{ union }}") |
| } |
| } |
| extern "C" { |
| pub fn selinux_get_callback(type_: ::std::os::raw::c_int) -> selinux_callback; |
| } |
| extern "C" { |
| pub fn selinux_set_callback(type_: ::std::os::raw::c_int, cb: selinux_callback); |
| } |
| extern "C" { |
| pub fn security_compute_av( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| avd: *mut av_decision, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_av_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| avd: *mut av_decision, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_av_flags( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| avd: *mut av_decision, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_av_flags_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| avd: *mut av_decision, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_create( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_create_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_create_name( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| objname: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_create_name_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| objname: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_relabel( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_relabel_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_member( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_compute_member_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_validatetrans( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_validatetrans_raw( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: security_class_t, |
| newcon: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_load_policy( |
| data: *const ::std::os::raw::c_void, |
| len: usize, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_get_initial_context( |
| name: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_get_initial_context_raw( |
| name: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_mkload_policy(preservebools: ::std::os::raw::c_int) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_init_load_policy(enforce: *mut ::std::os::raw::c_int) -> ::std::os::raw::c_int; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct SELboolean { |
| pub name: *mut ::std::os::raw::c_char, |
| pub value: ::std::os::raw::c_int, |
| } |
| extern "C" { |
| pub fn security_set_boolean_list( |
| boolcnt: usize, |
| boollist: *mut SELboolean, |
| permanent: ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_check_context(con: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_check_context_raw(con: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_canonicalize_context( |
| con: *const ::std::os::raw::c_char, |
| canoncon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_canonicalize_context_raw( |
| con: *const ::std::os::raw::c_char, |
| canoncon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_getenforce() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_setenforce(value: ::std::os::raw::c_int) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_reject_unknown() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_deny_unknown() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_get_checkreqprot() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_disable() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_policyvers() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_get_boolean_names( |
| names: *mut *mut *mut ::std::os::raw::c_char, |
| len: *mut ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_get_boolean_pending( |
| name: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_get_boolean_active( |
| name: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_set_boolean( |
| name: *const ::std::os::raw::c_char, |
| value: ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn security_commit_booleans() -> ::std::os::raw::c_int; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct security_class_mapping { |
| pub name: *const ::std::os::raw::c_char, |
| pub perms: [*const ::std::os::raw::c_char; 33usize], |
| } |
| extern "C" { |
| pub fn selinux_set_mapping(map: *const security_class_mapping) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn mode_to_security_class(mode: mode_t) -> security_class_t; |
| } |
| extern "C" { |
| pub fn string_to_security_class(name: *const ::std::os::raw::c_char) -> security_class_t; |
| } |
| extern "C" { |
| pub fn security_class_to_string(cls: security_class_t) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn security_av_perm_to_string( |
| tclass: security_class_t, |
| perm: access_vector_t, |
| ) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn string_to_av_perm( |
| tclass: security_class_t, |
| name: *const ::std::os::raw::c_char, |
| ) -> access_vector_t; |
| } |
| extern "C" { |
| pub fn security_av_string( |
| tclass: security_class_t, |
| av: access_vector_t, |
| result: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn print_access_vector(tclass: security_class_t, av: access_vector_t); |
| } |
| extern "C" { |
| pub fn selinux_flush_class_cache(); |
| } |
| extern "C" { |
| pub fn set_matchpathcon_printf( |
| f: ::std::option::Option<unsafe extern "C" fn(fmt: *const ::std::os::raw::c_char, ...)>, |
| ); |
| } |
| extern "C" { |
| pub fn set_matchpathcon_invalidcon( |
| f: ::std::option::Option< |
| unsafe extern "C" fn( |
| path: *const ::std::os::raw::c_char, |
| lineno: ::std::os::raw::c_uint, |
| context: *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int, |
| >, |
| ); |
| } |
| extern "C" { |
| pub fn set_matchpathcon_canoncon( |
| f: ::std::option::Option< |
| unsafe extern "C" fn( |
| path: *const ::std::os::raw::c_char, |
| lineno: ::std::os::raw::c_uint, |
| context: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int, |
| >, |
| ); |
| } |
| extern "C" { |
| pub fn set_matchpathcon_flags(flags: ::std::os::raw::c_uint); |
| } |
| extern "C" { |
| pub fn matchpathcon_filespec_add( |
| ino: ino_t, |
| specind: ::std::os::raw::c_int, |
| file: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn matchpathcon_filespec_destroy(); |
| } |
| extern "C" { |
| pub fn matchpathcon_filespec_eval(); |
| } |
| extern "C" { |
| pub fn matchpathcon_checkmatches(str_: *mut ::std::os::raw::c_char); |
| } |
| extern "C" { |
| pub fn matchmediacon( |
| media: *const ::std::os::raw::c_char, |
| con: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_getenforcemode(enforce: *mut ::std::os::raw::c_int) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_boolean_sub( |
| boolean_name: *const ::std::os::raw::c_char, |
| ) -> *mut ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_getpolicytype( |
| policytype: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_policy_root() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_set_policy_root( |
| rootpath: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_current_policy_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_binary_policy_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_failsafe_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_removable_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_default_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_user_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_file_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_file_context_homedir_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_file_context_local_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_file_context_subs_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_file_context_subs_dist_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_homedir_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_media_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_virtual_domain_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_virtual_image_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_lxc_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_x_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_sepgsql_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_openrc_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_openssh_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_snapperd_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_systemd_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_contexts_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_securetty_types_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_booleans_subs_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_customizable_types_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_usersconf_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_translations_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_colors_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_netfilter_context_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn selinux_check_access( |
| scon: *const ::std::os::raw::c_char, |
| tcon: *const ::std::os::raw::c_char, |
| tclass: *const ::std::os::raw::c_char, |
| perm: *const ::std::os::raw::c_char, |
| auditdata: *mut ::std::os::raw::c_void, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_check_securetty_context( |
| tty_context: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn set_selinuxmnt(mnt: *const ::std::os::raw::c_char); |
| } |
| extern "C" { |
| pub fn fini_selinuxmnt(); |
| } |
| extern "C" { |
| pub fn is_context_customizable( |
| scontext: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_trans_to_raw_context( |
| trans: *const ::std::os::raw::c_char, |
| rawp: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_raw_to_trans_context( |
| raw: *const ::std::os::raw::c_char, |
| transp: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_raw_context_to_color( |
| raw: *const ::std::os::raw::c_char, |
| color_str: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getseuserbyname( |
| linuxuser: *const ::std::os::raw::c_char, |
| seuser: *mut *mut ::std::os::raw::c_char, |
| level: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn getseuser( |
| username: *const ::std::os::raw::c_char, |
| service: *const ::std::os::raw::c_char, |
| r_seuser: *mut *mut ::std::os::raw::c_char, |
| r_level: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_file_context_cmp( |
| a: *const ::std::os::raw::c_char, |
| b: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_file_context_verify( |
| path: *const ::std::os::raw::c_char, |
| mode: mode_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_lsetfilecon_default( |
| path: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_reset_config(); |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct context_s_t { |
| pub ptr: *mut ::std::os::raw::c_void, |
| } |
| pub type context_t = *mut context_s_t; |
| extern "C" { |
| pub fn context_new(str_: *const ::std::os::raw::c_char) -> context_t; |
| } |
| extern "C" { |
| pub fn context_str(con: context_t) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn context_free(con: context_t); |
| } |
| extern "C" { |
| pub fn context_type_get(con: context_t) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn context_range_get(con: context_t) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn context_role_get(con: context_t) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn context_user_get(con: context_t) -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn context_type_set( |
| con: context_t, |
| type_: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn context_range_set( |
| con: context_t, |
| range: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn context_role_set( |
| con: context_t, |
| role: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn context_user_set( |
| con: context_t, |
| user: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct security_id { |
| pub ctx: *mut ::std::os::raw::c_char, |
| pub id: ::std::os::raw::c_uint, |
| } |
| pub type security_id_t = *mut security_id; |
| extern "C" { |
| pub fn avc_sid_to_context( |
| sid: security_id_t, |
| ctx: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_sid_to_context_raw( |
| sid: security_id_t, |
| ctx: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_context_to_sid( |
| ctx: *const ::std::os::raw::c_char, |
| sid: *mut security_id_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_context_to_sid_raw( |
| ctx: *const ::std::os::raw::c_char, |
| sid: *mut security_id_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_get_initial_sid( |
| name: *const ::std::os::raw::c_char, |
| sid: *mut security_id_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone)] |
| pub struct avc_entry { |
| _unused: [u8; 0], |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct avc_entry_ref { |
| pub ae: *mut avc_entry, |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct avc_memory_callback { |
| pub func_malloc: |
| ::std::option::Option<unsafe extern "C" fn(size: usize) -> *mut ::std::os::raw::c_void>, |
| pub func_free: ::std::option::Option<unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void)>, |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct avc_log_callback { |
| pub func_log: |
| ::std::option::Option<unsafe extern "C" fn(fmt: *const ::std::os::raw::c_char, ...)>, |
| pub func_audit: ::std::option::Option< |
| unsafe extern "C" fn( |
| auditdata: *mut ::std::os::raw::c_void, |
| cls: security_class_t, |
| msgbuf: *mut ::std::os::raw::c_char, |
| msgbufsize: usize, |
| ), |
| >, |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct avc_thread_callback { |
| pub func_create_thread: ::std::option::Option< |
| unsafe extern "C" fn( |
| run: ::std::option::Option<unsafe extern "C" fn()>, |
| ) -> *mut ::std::os::raw::c_void, |
| >, |
| pub func_stop_thread: |
| ::std::option::Option<unsafe extern "C" fn(thread: *mut ::std::os::raw::c_void)>, |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct avc_lock_callback { |
| pub func_alloc_lock: |
| ::std::option::Option<unsafe extern "C" fn() -> *mut ::std::os::raw::c_void>, |
| pub func_get_lock: |
| ::std::option::Option<unsafe extern "C" fn(lock: *mut ::std::os::raw::c_void)>, |
| pub func_release_lock: |
| ::std::option::Option<unsafe extern "C" fn(lock: *mut ::std::os::raw::c_void)>, |
| pub func_free_lock: |
| ::std::option::Option<unsafe extern "C" fn(lock: *mut ::std::os::raw::c_void)>, |
| } |
| extern "C" { |
| pub fn avc_open( |
| opts: *const selinux_opt, |
| nopts: ::std::os::raw::c_uint, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_cleanup(); |
| } |
| extern "C" { |
| pub fn avc_reset() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_destroy(); |
| } |
| extern "C" { |
| pub fn avc_has_perm_noaudit( |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| aeref: *mut avc_entry_ref, |
| avd: *mut av_decision, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_has_perm( |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| aeref: *mut avc_entry_ref, |
| auditdata: *mut ::std::os::raw::c_void, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_audit( |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| requested: access_vector_t, |
| avd: *mut av_decision, |
| result: ::std::os::raw::c_int, |
| auditdata: *mut ::std::os::raw::c_void, |
| ); |
| } |
| extern "C" { |
| pub fn avc_compute_create( |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| newsid: *mut security_id_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_compute_member( |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| newsid: *mut security_id_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_add_callback( |
| callback: ::std::option::Option< |
| unsafe extern "C" fn( |
| event: u32, |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| perms: access_vector_t, |
| out_retained: *mut access_vector_t, |
| ) -> ::std::os::raw::c_int, |
| >, |
| events: u32, |
| ssid: security_id_t, |
| tsid: security_id_t, |
| tclass: security_class_t, |
| perms: access_vector_t, |
| ) -> ::std::os::raw::c_int; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct avc_cache_stats { |
| pub entry_lookups: ::std::os::raw::c_uint, |
| pub entry_hits: ::std::os::raw::c_uint, |
| pub entry_misses: ::std::os::raw::c_uint, |
| pub entry_discards: ::std::os::raw::c_uint, |
| pub cav_lookups: ::std::os::raw::c_uint, |
| pub cav_hits: ::std::os::raw::c_uint, |
| pub cav_probes: ::std::os::raw::c_uint, |
| pub cav_misses: ::std::os::raw::c_uint, |
| } |
| extern "C" { |
| pub fn avc_cache_stats(stats: *mut avc_cache_stats); |
| } |
| extern "C" { |
| pub fn avc_av_stats(); |
| } |
| extern "C" { |
| pub fn avc_sid_stats(); |
| } |
| extern "C" { |
| pub fn avc_netlink_open(blocking: ::std::os::raw::c_int) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_netlink_loop(); |
| } |
| extern "C" { |
| pub fn avc_netlink_close(); |
| } |
| extern "C" { |
| pub fn avc_netlink_acquire_fd() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn avc_netlink_release_fd(); |
| } |
| extern "C" { |
| pub fn avc_netlink_check_nb() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_status_open(fallback: ::std::os::raw::c_int) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_status_close(); |
| } |
| extern "C" { |
| pub fn selinux_status_updated() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_status_getenforce() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_status_policyload() -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_status_deny_unknown() -> ::std::os::raw::c_int; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone)] |
| pub struct selabel_handle { |
| _unused: [u8; 0], |
| } |
| extern "C" { |
| pub fn selabel_open( |
| backend: ::std::os::raw::c_uint, |
| opts: *const selinux_opt, |
| nopts: ::std::os::raw::c_uint, |
| ) -> *mut selabel_handle; |
| } |
| extern "C" { |
| pub fn selabel_close(handle: *mut selabel_handle); |
| } |
| extern "C" { |
| pub fn selabel_lookup( |
| handle: *mut selabel_handle, |
| con: *mut *mut ::std::os::raw::c_char, |
| key: *const ::std::os::raw::c_char, |
| type_: ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selabel_lookup_raw( |
| handle: *mut selabel_handle, |
| con: *mut *mut ::std::os::raw::c_char, |
| key: *const ::std::os::raw::c_char, |
| type_: ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selabel_partial_match( |
| handle: *mut selabel_handle, |
| key: *const ::std::os::raw::c_char, |
| ) -> bool; |
| } |
| extern "C" { |
| pub fn selabel_get_digests_all_partial_matches( |
| rec: *mut selabel_handle, |
| key: *const ::std::os::raw::c_char, |
| calculated_digest: *mut *mut u8, |
| xattr_digest: *mut *mut u8, |
| digest_len: *mut usize, |
| ) -> bool; |
| } |
| extern "C" { |
| pub fn selabel_hash_all_partial_matches( |
| rec: *mut selabel_handle, |
| key: *const ::std::os::raw::c_char, |
| digest: *mut u8, |
| ) -> bool; |
| } |
| extern "C" { |
| pub fn selabel_lookup_best_match( |
| rec: *mut selabel_handle, |
| con: *mut *mut ::std::os::raw::c_char, |
| key: *const ::std::os::raw::c_char, |
| aliases: *mut *const ::std::os::raw::c_char, |
| type_: ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selabel_lookup_best_match_raw( |
| rec: *mut selabel_handle, |
| con: *mut *mut ::std::os::raw::c_char, |
| key: *const ::std::os::raw::c_char, |
| aliases: *mut *const ::std::os::raw::c_char, |
| type_: ::std::os::raw::c_int, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selabel_digest( |
| rec: *mut selabel_handle, |
| digest: *mut *mut ::std::os::raw::c_uchar, |
| digest_len: *mut usize, |
| specfiles: *mut *mut *mut ::std::os::raw::c_char, |
| num_specfiles: *mut usize, |
| ) -> ::std::os::raw::c_int; |
| } |
| pub mod selabel_cmp_result { |
| pub type Type = ::std::os::raw::c_uint; |
| pub const SELABEL_SUBSET: Type = 0; |
| pub const SELABEL_EQUAL: Type = 1; |
| pub const SELABEL_SUPERSET: Type = 2; |
| pub const SELABEL_INCOMPARABLE: Type = 3; |
| } |
| extern "C" { |
| pub fn selabel_cmp( |
| h1: *const selabel_handle, |
| h2: *const selabel_handle, |
| ) -> selabel_cmp_result::Type; |
| } |
| extern "C" { |
| pub fn selabel_stats(handle: *mut selabel_handle); |
| } |
| extern "C" { |
| pub fn selinux_restorecon( |
| pathname: *const ::std::os::raw::c_char, |
| restorecon_flags: ::std::os::raw::c_uint, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_restorecon_parallel( |
| pathname: *const ::std::os::raw::c_char, |
| restorecon_flags: ::std::os::raw::c_uint, |
| nthreads: usize, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_restorecon_set_sehandle(hndl: *mut selabel_handle); |
| } |
| extern "C" { |
| pub fn selinux_restorecon_default_handle() -> *mut selabel_handle; |
| } |
| extern "C" { |
| pub fn selinux_restorecon_set_exclude_list(exclude_list: *mut *const ::std::os::raw::c_char); |
| } |
| extern "C" { |
| pub fn selinux_restorecon_set_alt_rootpath( |
| alt_rootpath: *const ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| pub mod digest_result { |
| pub type Type = ::std::os::raw::c_uint; |
| pub const MATCH: Type = 0; |
| pub const NOMATCH: Type = 1; |
| pub const DELETED_MATCH: Type = 2; |
| pub const DELETED_NOMATCH: Type = 3; |
| pub const ERROR: Type = 4; |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] |
| pub struct dir_xattr { |
| pub directory: *mut ::std::os::raw::c_char, |
| pub digest: *mut ::std::os::raw::c_char, |
| pub result: digest_result::Type, |
| pub next: *mut dir_xattr, |
| } |
| extern "C" { |
| pub fn selinux_restorecon_xattr( |
| pathname: *const ::std::os::raw::c_char, |
| xattr_flags: ::std::os::raw::c_uint, |
| xattr_list: *mut *mut *mut dir_xattr, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_restorecon_get_skipped_errors() -> ::std::os::raw::c_ulong; |
| } |
| extern "C" { |
| pub fn get_ordered_context_list( |
| user: *const ::std::os::raw::c_char, |
| fromcon: *const ::std::os::raw::c_char, |
| list: *mut *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn get_ordered_context_list_with_level( |
| user: *const ::std::os::raw::c_char, |
| level: *const ::std::os::raw::c_char, |
| fromcon: *const ::std::os::raw::c_char, |
| list: *mut *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn get_default_context( |
| user: *const ::std::os::raw::c_char, |
| fromcon: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn get_default_context_with_level( |
| user: *const ::std::os::raw::c_char, |
| level: *const ::std::os::raw::c_char, |
| fromcon: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn get_default_context_with_role( |
| user: *const ::std::os::raw::c_char, |
| role: *const ::std::os::raw::c_char, |
| fromcon: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn get_default_context_with_rolelevel( |
| user: *const ::std::os::raw::c_char, |
| role: *const ::std::os::raw::c_char, |
| level: *const ::std::os::raw::c_char, |
| fromcon: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn query_user_context( |
| list: *mut *mut ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn manual_user_enter_context( |
| user: *const ::std::os::raw::c_char, |
| newcon: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |
| extern "C" { |
| pub fn selinux_default_type_path() -> *const ::std::os::raw::c_char; |
| } |
| extern "C" { |
| pub fn get_default_type( |
| role: *const ::std::os::raw::c_char, |
| type_: *mut *mut ::std::os::raw::c_char, |
| ) -> ::std::os::raw::c_int; |
| } |