-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: request-example openfile #384
Conversation
Hi @puellanivis this seems a great work, thank you! |
… and sfftp.Request.Target come up
OK, I think all that is left, is a bit of verification of SSH vs POSIX semantics (like (also an escape hatch for too many symlinks followed) |
…a dangling symlink target
Alright, getting any more compliance of out this fake system would definitely require significantly more effort, and a pretty complete overhaul. So, I’m going to leave it here, and we can attack potential further non-compliance issues as they come, or reimplement the in-memory-filesystem more properly in another PR. I have taken the time to expand support for a |
2961ae1
to
c462167
Compare
It looks good to me, thank you! |
While looking into Issue-383, I realized that there were a small bunch of corner cases not being covered properly. This ended up being a bit more than just the openfile refactor, but in the end ends up with much improved semantics when dealing with the MemFile handler.
During development a large number of tests started panicking when I broke file creation. The tests should not panic, and their
assert.Nil
orassert.NoError
tests have been replaced with arequire.NoError
. Allassert.Nil
of error values have been replaced with eitherassert.NoError
orrequire.NoError
.As such there are a heavy number of test lines changed, which do not actually change any behavior of the tests at all.
Resolved:
O_TRUNC
was being ignored on existing files.O_EXCL
andO_CREATE
were being ignored.os.ErrNotExist
O_CREATE
with a dangling symlink should create the target filename, not the symlink‘s nameKnown issue: