From owner-trustedbsd-cvs@FreeBSD.ORG Mon Dec 4 18:50:54 2006 Return-Path: X-Original-To: trustedbsd-cvs@freebsd.org Delivered-To: trustedbsd-cvs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C2F816A492 for ; Mon, 4 Dec 2006 18:50:54 +0000 (UTC) (envelope-from owner-perforce@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F64943CB1 for ; Mon, 4 Dec 2006 18:50:04 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by cyrus.watson.org (Postfix) with ESMTP id 25D2E46F5C for ; Mon, 4 Dec 2006 13:50:37 -0500 (EST) Received: from hub.freebsd.org (hub.freebsd.org [69.147.83.54]) by mx2.freebsd.org (Postfix) with ESMTP id 2871AD0716; Mon, 4 Dec 2006 18:47:03 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id B55A916A684; Mon, 4 Dec 2006 18:46:54 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7405A16A67D for ; Mon, 4 Dec 2006 18:46:54 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 121AB43CBE for ; Mon, 4 Dec 2006 18:46:16 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kB4IkpWt092754 for ; Mon, 4 Dec 2006 18:46:51 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kB4IkoWX092749 for perforce@freebsd.org; Mon, 4 Dec 2006 18:46:50 GMT (envelope-from millert@freebsd.org) Date: Mon, 4 Dec 2006 18:46:50 GMT Message-Id: <200612041846.kB4IkoWX092749@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 111062 for review X-BeenThere: trustedbsd-cvs@FreeBSD.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: TrustedBSD CVS and Perforce commit message list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2006 18:50:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=111062 Change 111062 by millert@millert_g5tower on 2006/12/04 18:46:12 In getfilesids1() use sidtab_search_context() instead of sidtab_context_to_sid() to validate sids. The latter will insert a non-existent sid into the table which is not what we want. Fixes the security.mac.sebsd.file.sids sysctl. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/ss/services.c#4 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/ss/services.c#4 (text+ko) ==== @@ -1680,7 +1680,7 @@ if (constraint == NULL && mls_context_isvalid(&policydb, &fc) && - sidtab_context_to_sid(&sidtab, &fc, &sid) == 0) { + (sid = sidtab_search_context(&sidtab, &fc)) != 0) { /* passed all checks, add to list */ if (p->numsids == p->maxsids) { u32 *sids; @@ -1702,7 +1702,7 @@ return 0; } -int security_get_file_sids(u32 user, +int security_get_file_sids(u32 usersid, u16 sclass, u32 **sids, u32 *numsids) @@ -1722,7 +1722,7 @@ POLICY_RDLOCK; - scontext = sidtab_search(&sidtab, user); + scontext = sidtab_search(&sidtab, usersid); if (scontext == NULL) { rc = EINVAL; goto out_unlock;