Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2002 06:37:33 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 9996 for review
Message-ID:  <200204191337.g3JDbXs40812@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204191337.g3JDbXs40812>