Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cannot request files beneath base. #6

Closed
allenap opened this Issue · 3 comments

2 participants

@allenap

FilesystemSynchronousBackend uses FilePath.child() to resolve the requested file to a file on disk. However, FilePath.child() rejects paths containing directory separators.

@shylent
Owner

I suppose, there will be no harm in allowing unlimited "downwards" traversal (that is allow requests of any files that are actually beneath base). The fix is really simple so all I need it to write a couple of tests for this new case and that's all.

@shylent shylent was assigned
@shylent
Owner

On the second thought, though, what would one do when requesting a write to a directory that is beneath base, but which path contains fragment that don't exist on the file system. Say, base is /foo, which is an empty directory and one requests a write to /foo/bar/baz, which is "kind of" safe, but one expects from the backend in this case? To create missing fragments? Indicate an error ("File not found" or "Access violation" seem to be suitable error types)? I am not sure, to be honest

@allenap allenap referenced this issue
Merged

Files beneath base #9

@allenap

This change is opinionated in that regard: it creates those directories. A further change could make this configurable. We're only using the server for reads, so the write support for nested directories was done only for completeness; it wouldn't affect me to remove the makedirs() call and return an error instead.

@shylent shylent closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.