Home | History | Annotate | Download | only in kern

Lines Matching defs:scope

64 	kauth_scope_t			scope;		/* scope backpointer */
70 * Scope.
73 const char *id; /* scope name */
77 SIMPLEQ_ENTRY(kauth_scope) next_scope; /* scope list */
739 * Returns a scope matching the provided id.
740 * Requires the scope list lock to be held by the caller.
745 kauth_scope_t scope;
749 scope = NULL;
750 SIMPLEQ_FOREACH(scope, &scope_list, next_scope) {
751 if (strcmp(scope->id, id) == 0)
755 scope);
759 * Register a new scope.
761 * id - identifier for the scope
762 * callback - the scope's default listener
769 kauth_scope_t scope;
776 /* Allocate space for a new scope and listener. */
777 scope = kmem_alloc(sizeof(*scope), KM_SLEEP);
782 * Acquire scope list lock.
786 /* Check we don't already have a scope with the same id */
790 kmem_free(scope, sizeof(*scope));
797 /* Initialize new scope with parameters */
798 scope->id = id;
799 scope->cookie = cookie;
800 scope->nlisteners = 1;
802 SIMPLEQ_INIT(&scope->listenq);
807 listener->scope = scope;
809 SIMPLEQ_INSERT_HEAD(&scope->listenq, listener, listener_next);
812 /* Insert scope to scopes list */
813 SIMPLEQ_INSERT_TAIL(&scope_list, scope, next_scope);
817 return (scope);
825 * Register the credentials scope, used in kauth(9) internally.
840 /* Register credentials scope. */
844 /* Register generic scope. */
848 /* Register system scope. */
852 /* Register process scope. */
856 /* Register network scope. */
860 /* Register machdep scope. */
864 /* Register device scope. */
868 /* Register vnode scope. */
874 * Deregister a scope.
875 * Requires scope list lock to be held by the caller.
877 * scope - the scope to deregister
880 kauth_deregister_scope(kauth_scope_t scope)
882 if (scope != NULL) {
883 /* Remove scope from list */
884 SIMPLEQ_REMOVE(&scope_list, scope, kauth_scope, next_scope);
885 kmem_free(scope, sizeof(*scope));
892 * id - scope identifier.
900 kauth_scope_t scope;
907 * Find scope struct.
909 scope = kauth_ifindscope(id);
910 if (scope == NULL) {
922 /* Add listener to scope */
923 SIMPLEQ_INSERT_TAIL(&scope->listenq, listener, listener_next);
925 /* Raise number of listeners on scope. */
926 scope->nlisteners++;
927 listener->scope = scope;
945 SIMPLEQ_REMOVE(&listener->scope->listenq, listener,
947 listener->scope->nlisteners--;
956 * scope - the scope of the request as defined by KAUTH_SCOPE_* or as
969 kauth_authorize_action_internal(kauth_scope_t scope, kauth_cred_t cred,
982 KASSERT(scope != NULL);
988 SIMPLEQ_FOREACH(listener, &scope->listenq, listener_next) {
989 error = listener->func(cred, action, scope->cookie, arg0,
1009 kauth_authorize_action(kauth_scope_t scope, kauth_cred_t cred,
1014 r = kauth_authorize_action_internal(scope, cred, action, arg0, arg1,
1030 * Generic scope authorization wrapper.
1040 * System scope authorization wrapper.
1051 * Process scope authorization wrapper.
1062 * Network scope authorization wrapper.