git: 9front

Download patch

ref: 88e8569d8abc65259507fae78b15f6bc41ffb366
parent: 9a4719e9203c6e9d4def0da3a3d3b3f43d58213e
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Wed Sep 5 21:05:37 EDT 2012

devshr: honor noattach

--- a/sys/src/9/port/devshr.c
+++ b/sys/src/9/port/devshr.c
@@ -458,6 +458,8 @@
 		cclose(c);
 		return nc;	
 	case Qcroot:
+		if(up->pgrp->noattach)
+			error(Enoattach);
 		if((perm & DMDIR) == 0 || openmode(omode) != OREAD)
 			error(Eperm);
 		if(strlen(name) >= sizeof(up->genbuf))
@@ -490,6 +492,8 @@
 		sch->shr = shr;
 		break;
 	case Qcshr:
+		if(up->pgrp->noattach)
+			error(Enoattach);
 		if((perm & DMDIR) || openmode(omode) != OWRITE)
 			error(Eperm);
 
@@ -720,6 +724,8 @@
 		int	flags;
 	}bogus;
 
+	if(up->pgrp->noattach)
+		error(Enoattach);
 	sch = tosch(c);
 	if(sch->level != Qcmpt)
 		error(Egreg);
--