From 633397bfda41efb7c3c9a4173cedfe8e45ea83a4 Mon Sep 17 00:00:00 2001 From: aiju Date: Sun, 4 Mar 2018 19:52:35 +0000 Subject: [PATCH] sshfs: update qid and filename on Tcreate --- sys/src/cmd/sshfs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/src/cmd/sshfs.c b/sys/src/cmd/sshfs.c index e42b7807a..5266ec799 100644 --- a/sys/src/cmd/sshfs.c +++ b/sys/src/cmd/sshfs.c @@ -934,7 +934,7 @@ recvproc(void *) SFid *sf; int t, id; u32int code; - char *msg, *lang, *hand; + char *msg, *lang, *hand, *s; int msgn, langn, handn; int okresp; char *e; @@ -1011,6 +1011,14 @@ recvproc(void *) sf->handn = handn; sf->hand = emalloc9p(sf->handn); memcpy(sf->hand, hand, sf->handn); + if(r->req->ifcall.type == Tcreate){ + s = sf->fn; + sf->fn = pathcat(s, r->req->ifcall.name); + free(s); + sf->qid = (Qid){qidcalc(sf->fn), 0, (r->req->ifcall.perm & DMDIR) != 0 ? QTDIR : 0}; + r->req->ofcall.qid = sf->qid; + r->req->fid->qid = sf->qid; + } wunlock(sf); if(r->req->ifcall.type == Tread){ r->req->aux = nil; -- 2.44.0