Esempio n. 1
0
kern_return_t
stop_kauth(void)
{
    if (l_listener != NULL)
    {
        kauth_unlisten_scope(l_listener);
        l_listener = NULL;
    }
    return KERN_SUCCESS;
}
void UserPatcher::deinit() {
	if (listener) {
		kauth_unlisten_scope(listener);
		listener = nullptr;
	}
	
	lookupStorage.deinit();
	for (size_t i = 0; i < Lookup::matchNum; i++)
		lookup.c[i].deinit();
}
Esempio n. 3
0
/*
 * Stop the overlay security model.
 */
void
secmodel_overlay_stop(void)
{
	kauth_unlisten_scope(l_generic);
	kauth_unlisten_scope(l_system);
	kauth_unlisten_scope(l_process);
	kauth_unlisten_scope(l_network);
	kauth_unlisten_scope(l_machdep);
	kauth_unlisten_scope(l_device);
	kauth_unlisten_scope(l_vnode);
}
void
secmodel_securelevel_stop(void)
{
	kauth_unlisten_scope(l_system);
	kauth_unlisten_scope(l_process);
	kauth_unlisten_scope(l_network);
	kauth_unlisten_scope(l_machdep);
	kauth_unlisten_scope(l_device);
	kauth_unlisten_scope(l_vnode);
}
int
    collector_1_deinitialize
    (

    )
{
#ifndef _DISABLE_COLLECTOR_1
    rpal_mutex_lock( g_collector_1_mutex );
#ifdef _USE_KAUTH
    kauth_unlisten_scope( g_listener );
#else
    mac_policy_unregister( g_policy );
#endif
    rpal_mutex_free( g_collector_1_mutex );
#endif
    return 1;
}
static int
procfs_modcmd(modcmd_t cmd, void *arg)
{
	int error;

	switch (cmd) {
	case MODULE_CMD_INIT:
		error = vfs_attach(&procfs_vfsops);
		if (error != 0)
			break;
		sysctl_createv(&procfs_sysctl_log, 0, NULL, NULL,
			       CTLFLAG_PERMANENT,
			       CTLTYPE_NODE, "vfs", NULL,
			       NULL, 0, NULL, 0,
			       CTL_VFS, CTL_EOL);
		sysctl_createv(&procfs_sysctl_log, 0, NULL, NULL,
			       CTLFLAG_PERMANENT,
			       CTLTYPE_NODE, "procfs",
			       SYSCTL_DESCR("Process file system"),
			       NULL, 0, NULL, 0,
			       CTL_VFS, 12, CTL_EOL);
		/*
		 * XXX the "12" above could be dynamic, thereby eliminating
		 * one more instance of the "number to vfs" mapping problem,
		 * but "12" is the order as taken from sys/mount.h
		 */

		procfs_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS,
		    procfs_listener_cb, NULL);

		break;
	case MODULE_CMD_FINI:
		error = vfs_detach(&procfs_vfsops);
		if (error != 0)
			break;
		sysctl_teardown(&procfs_sysctl_log);
		kauth_unlisten_scope(procfs_listener);
		break;
	default:
		error = ENOTTY;
		break;
	}

	return (error);
}