From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 2 Jan 2012 20:14:11 +0100 From: David du Colombier <0intro@gmail.com> To: 9fans@9fans.net Message-ID: <20120102201411.5c524a65@gmail.com> In-Reply-To: <864nwet1z8.fsf@cmarib.ramside> References: <86zkecbc5d.fsf@cmarib.ramside> <20111229004856.731689ce@gmail.com> <20111230181551.2b46cb7f@gmail.com> <86fwfy61j8.fsf@cmarib.ramside> <20120102145058.48acbdf0@wks-ddc.exosec.local> <864nwet1z8.fsf@cmarib.ramside> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [9fans] p9p vac/vacfs compatibility: uid/gid, ctime, 9P2000.L, 9pserve Topicbox-Message-UUID: 5322d61a-ead7-11e9-9d60-3106f5b1d025 > Would you care to share? Sure. But beware it's just a quick hack. diff -r 92a579c6549c src/cmd/9pfuse/main.c --- a/src/cmd/9pfuse/main.c Mon Dec 12 16:44:50 2011 -0500 +++ b/src/cmd/9pfuse/main.c Mon Jan 02 19:00:00 2012 +0100 @@ -837,6 +837,8 @@ void fusereadlink(FuseMsg *m) { + int n; + uchar *buf; Dir *d; CFid *fid; @@ -852,9 +854,19 @@ replyfuseerrno(m, EINVAL); return; } - replyfuse(m, d->ext, strlen(d->ext)); + n = d->length; free(d); - return; + if(n > fusemaxwrite) + n = fusemaxwrite; + buf = emalloc(n); + n = fsread(fid, buf, n); + if(n < 0){ + free(buf); + replyfuseerrstr(m); + return; + } + replyfuse(m, buf, n); + free(buf); } /* diff -r 92a579c6549c src/cmd/vac/vacfs.c --- a/src/cmd/vac/vacfs.c Mon Dec 12 16:44:50 2011 -0500 +++ b/src/cmd/vac/vacfs.c Mon Jan 02 19:00:00 2012 +0100 @@ -548,8 +548,6 @@ n = vacdirread(f, buf, off, cnt); else if(vacfilegetmode(f->file)&ModeDevice) return vtstrdup("device"); - else if(vacfilegetmode(f->file)&ModeLink) - return vtstrdup("symbolic link"); else if(vacfilegetmode(f->file)&ModeNamedPipe) return vtstrdup("named pipe"); else Then symlinks are working. Now you need to fix the uid/gid problem and handle devices, named pipes and sockets in 9pserve. Also, you should apply this patch: http://codereview.appspot.com/download/issue5500097_1.diff It fixes two problems: - fix segfault when the first file is DMSYMLINK or DMDEVICE, - set the buffer to zero before calling readlink. Symlinks will not work without this patch. -- David du Colombier