exportfs: properly reply to chdir() error when we speak 9p
when we got a bad root tree, we should speak the right language and return a Rerror response instead of crapping ascii into the 9p conversation.
This commit is contained in:
parent
a9b1e990b8
commit
232a064f3a
1 changed files with 8 additions and 1 deletions
|
@ -249,8 +249,15 @@ main(int argc, char **argv)
|
|||
}
|
||||
else if(srv != nil) {
|
||||
if(chdir(srv) < 0) {
|
||||
ebuf[0] = '\0';
|
||||
errstr(ebuf, sizeof ebuf);
|
||||
fprint(0, "chdir(\"%s\"): %s\n", srv, ebuf);
|
||||
r = getsbuf();
|
||||
r->work.tag = NOTAG;
|
||||
r->work.fid = NOFID;
|
||||
r->work.type = Rerror;
|
||||
r->work.ename = ebuf;
|
||||
n = convS2M(&r->work, r->buf, messagesize);
|
||||
write(0, r->buf, n);
|
||||
DEBUG(DFD, "chdir(\"%s\"): %s\n", srv, ebuf);
|
||||
exits(ebuf);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue