diff --git a/sys/kern/kern_auth.c b/sys/kern/kern_auth.c index 396b6167970d..e370758a80d6 100644 --- a/sys/kern/kern_auth.c +++ b/sys/kern/kern_auth.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_auth.c,v 1.17 2006/08/20 15:05:14 christos Exp $ */ +/* $NetBSD: kern_auth.c,v 1.18 2006/09/02 20:10:24 elad Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat @@ -701,6 +701,10 @@ kauth_authorize_action(kauth_scope_t scope, kauth_cred_t cred, if (cred == NOCRED || cred == FSCRED) return (0); + /* Short-circuit requests when there are no listeners. */ + if (SIMPLEQ_EMPTY(&scope->listenq)) + return (0); + /* * Each scope is associated with at least one listener. We need to * traverse that list of listeners, as long as they return either