shithub: riscv

Download patch

ref: 9c18f300a40496fba95cfea2fe06d02f71bb968a
parent: 577a9f763f0535391ef3190ea8214a4e420717af
author: cinap_lenrek <[email protected]>
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);