From owner-p4-projects Fri Apr 19 6:37:41 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7EE4237B417; Fri, 19 Apr 2002 06:37:34 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A286D37B416 for ; Fri, 19 Apr 2002 06:37:33 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3JDbXs40812 for perforce@freebsd.org; Fri, 19 Apr 2002 06:37:33 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 19 Apr 2002 06:37:33 -0700 (PDT) Message-Id: <200204191337.g3JDbXs40812@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 9996 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://people.freebsd.org/~peter/p4db/chv.cgi?CH=9996 Change 9996 by rwatson@rwatson_tislabs on 2002/04/19 06:36:48 Pro-active diff reduction. Restructure the proc0/proc1 credential divorcing to reflect the crcopy() approach now used in the main tree. This is identical to the code committed to the main tree a few minutes ago, and reduces diffs between the trees. Affected files ... ... //depot/projects/trustedbsd/mac/sys/kern/init_main.c#18 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/init_main.c#18 (text+ko) ==== @@ -644,12 +644,11 @@ if (error) panic("cannot fork init: %d\n", error); /* divorce init's credentials from the kernel's */ - oldcred = initproc->p_ucred; - newcred = crdup(oldcred); - if (newcred == NULL) - panic("cannot generate ucred for init: %d\n", error); + newcred = crget(); PROC_LOCK(initproc); initproc->p_flag |= P_SYSTEM; + oldcred = initproc->p_ucred; + crcopy(newcred, oldcred); initproc->p_ucred = newcred; PROC_UNLOCK(initproc); crfree(oldcred); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message