devshr: honor noattach
This commit is contained in:
parent
577a9f763f
commit
9c18f300a4
|
@ -458,6 +458,8 @@ shrcreate(Chan *c, char *name, int omode, ulong perm)
|
||||||
cclose(c);
|
cclose(c);
|
||||||
return nc;
|
return nc;
|
||||||
case Qcroot:
|
case Qcroot:
|
||||||
|
if(up->pgrp->noattach)
|
||||||
|
error(Enoattach);
|
||||||
if((perm & DMDIR) == 0 || openmode(omode) != OREAD)
|
if((perm & DMDIR) == 0 || openmode(omode) != OREAD)
|
||||||
error(Eperm);
|
error(Eperm);
|
||||||
if(strlen(name) >= sizeof(up->genbuf))
|
if(strlen(name) >= sizeof(up->genbuf))
|
||||||
|
@ -490,6 +492,8 @@ shrcreate(Chan *c, char *name, int omode, ulong perm)
|
||||||
sch->shr = shr;
|
sch->shr = shr;
|
||||||
break;
|
break;
|
||||||
case Qcshr:
|
case Qcshr:
|
||||||
|
if(up->pgrp->noattach)
|
||||||
|
error(Enoattach);
|
||||||
if((perm & DMDIR) || openmode(omode) != OWRITE)
|
if((perm & DMDIR) || openmode(omode) != OWRITE)
|
||||||
error(Eperm);
|
error(Eperm);
|
||||||
|
|
||||||
|
@ -720,6 +724,8 @@ shrwrite(Chan *c, void *va, long n, vlong)
|
||||||
int flags;
|
int flags;
|
||||||
}bogus;
|
}bogus;
|
||||||
|
|
||||||
|
if(up->pgrp->noattach)
|
||||||
|
error(Enoattach);
|
||||||
sch = tosch(c);
|
sch = tosch(c);
|
||||||
if(sch->level != Qcmpt)
|
if(sch->level != Qcmpt)
|
||||||
error(Egreg);
|
error(Egreg);
|
||||||
|
|
Loading…
Reference in a new issue