PERFORCE change 123323 for review

Marko Zec zec at FreeBSD.org
Wed Jul 11 14:01:06 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=123323

Change 123323 by zec at zec_tca51 on 2007/07/11 14:00:08

	Prohibit a vimage from reconfiguring and / or destroying itself.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#24 edit

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#24 (text+ko) ====

@@ -177,6 +177,8 @@
 vi_child_of(parent, child)
 	struct vimage *parent, *child;
 {
+	if (child == parent)
+		return (0);
 	for (; child; child = child->vi_parent)
 		if (child == parent)
 			return (1);
@@ -338,9 +340,9 @@
 	} else
 		vip_r = vip;
 
-	if (vip_r && vip != &vimage_0 && !vi_child_of(vip, vip_r)) {
+	if (vip_r && !vi_child_of(vip, vip_r) &&
+	    vi_req->req_action != VI_GET && vi_req->req_action != VI_GETNEXT)
 		return (EPERM);
-	}
 
 	switch (cmd) {
 


More information about the p4-projects mailing list