From 0ac991a582c76a081d962cd4a13aa1c612e2ef67 Mon Sep 17 00:00:00 2001 From: elad Date: Mon, 15 Jan 2007 17:47:06 +0000 Subject: [PATCH] Avoid proc_uidmatch() for rlimits if p is curproc. --- sys/secmodel/bsd44/secmodel_bsd44_suser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/secmodel/bsd44/secmodel_bsd44_suser.c b/sys/secmodel/bsd44/secmodel_bsd44_suser.c index e0ecea249c91..0ca95686619c 100644 --- a/sys/secmodel/bsd44/secmodel_bsd44_suser.c +++ b/sys/secmodel/bsd44/secmodel_bsd44_suser.c @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_bsd44_suser.c,v 1.31 2007/01/09 16:19:27 elad Exp $ */ +/* $NetBSD: secmodel_bsd44_suser.c,v 1.32 2007/01/15 17:47:06 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_bsd44_suser.c,v 1.31 2007/01/09 16:19:27 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_bsd44_suser.c,v 1.32 2007/01/15 17:47:06 elad Exp $"); #include #include @@ -515,7 +515,8 @@ secmodel_bsd44_suser_process_cb(kauth_cred_t cred, kauth_action_t action, break; } - if (proc_uidmatch(cred, p->p_cred) != 0) { + if ((p != curlwp->l_proc) && + (proc_uidmatch(cred, p->p_cred) != 0)) { result = KAUTH_RESULT_DENY; break; }