docker-archive / go-p9p

A modern, performant 9P library for Go.
Apache License 2.0
206 stars 50 forks source link

9pr: cd/ls broken #14

Open kennylevinsen opened 8 years ago

kennylevinsen commented 8 years ago
stevvooe commented 8 years ago

@joushou Can you reproduce this with 9pr/9ps or was this with another implementation?

kennylevinsen commented 8 years ago

I can't get 9pr to connect to 9ps at all now that I try.

I was 9pr against my own fileserver from https://github.com/joushou/qptools (there's two example implementations, ramfs and exportfs for convenience). Implementations that proxy the requests to the local fileserver (exportfs in qptools included, most likely also 9ps) probably permit walks to []string{""} due to platform details, but a "cleaner" server (ramfs in qptools, for example) will treat a walk to []string{""} as looking for a file without a name, and just spit out a no such file or directory error.

The issue appears to be related to some crude argument processing in 9pr, using string manipulation (strings.Split, strings.Trim, ...) to try to generate the path slice. Cutting off the last entry off it's 0 length fixes a plain "ls", but cd still behaves weird. Haven't had time to look at it. I just spun 9pr up to test it for fun, after all.

stevvooe commented 8 years ago

@joushou I'll take a peak when I get some time. These are mostly just toys for demonstrating use of the package, but I can see them becoming a diagnostic tool in the future.

kennylevinsen commented 8 years ago

No rush - They are indeed useful as diagnostics tools, but I have my own implementation in qptools :)