From owner-p4-projects Fri Oct 18 10: 8:24 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BF45237B404; Fri, 18 Oct 2002 10:08:22 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EC5037B401 for ; Fri, 18 Oct 2002 10:08:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4668F43E91 for ; Fri, 18 Oct 2002 10:08:21 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9IH87mV063571 for ; Fri, 18 Oct 2002 10:08:07 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9IH86Nb063568 for perforce@freebsd.org; Fri, 18 Oct 2002 10:08:06 -0700 (PDT) Date: Fri, 18 Oct 2002 10:08:06 -0700 (PDT) Message-Id: <200210181708.g9IH86Nb063568@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 19550 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=19550 Change 19550 by rwatson@rwatson_tislabs on 2002/10/18 10:07:42 Minor cleanup: <= instead of <, remember to free the context, etc. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#44 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#44 (text+ko) ==== @@ -1061,19 +1061,18 @@ (*claimed)++; - error = security_sid_to_context(sid, &context, - &context_len); + error = security_sid_to_context(sid, &context, &context_len); if (error) return (error); - if (size < context_len) - return (EINVAL); - - *len = strlcpy(element_data, context, size); - if (*len <= size) - return (EINVAL); - - return (0); + if (size <= context_len) { + error = EINVAL; + else { + *len = strlcpy(element_data, context, size); + error = 0; + } + security_free_context(context); + return (error); } static int To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message