go-p9p icon indicating copy to clipboard operation
go-p9p copied to clipboard

9pr: cd/ls broken

Open kennylevinsen opened this issue 8 years ago • 4 comments

  • ls tries to walk to empty string (not empty walk!) if you just ls - that is, a file with an empty name, not the local directory.
  • cd doesn't seem to handle .., just sending a walk to empty string that fails.
  • cd to ".." (with the quotes) fails horribly, as 9pr starts to poke at unknown fids (probably didn't check that things

kennylevinsen avatar May 21 '16 19:05 kennylevinsen

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

stevvooe avatar May 25 '16 21:05 stevvooe

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.

kennylevinsen avatar May 25 '16 22:05 kennylevinsen

@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.

stevvooe avatar May 25 '16 22:05 stevvooe

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

kennylevinsen avatar May 25 '16 22:05 kennylevinsen