-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Multiple symlink resolution #8744
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
base: master
Are you sure you want to change the base?
Conversation
As an example, if the following symlinks exist: - `configfile` -> `intermediate` - `intermediate` -> `trampoline` - `trampoline` -> `actual_file` `rclone --config configfile config` would rewrite the `intermediate` path as a real file, breaking the symlink chain. Instead, chase all symlinks and rewrite `actual_file`.
267ca9b to
e6fbdcb
Compare
ncw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice idea.
What about using filepath.EvalSymlinks that should simplify the logic?
|
Ah, that does look a lot simpler. I'll try that out. I'll also add a test for a broken symlink. |
|
That breaks a lot of tests… |
Since the symlink resolution is now step-by-step (see parent commit), symlink loops must now be manually detected. Keep track of visited paths and error if we come across a path a second time.
|
I tried to use the |
1d2fe85 to
802eabd
Compare
802eabd to
aa4224c
Compare
I would prefer to use |
|
I think that loses error reporting fidelity as most of the |
|
@mathstuf start pulling on that thread and see what unravels - we can review after. |
|
I don't think it's going to work out. I believe the issue is that if the file doesn't exist, we get no information about any intermediate path resolution in the meantime. We would have to |
What is the purpose of this change?
Support config files living at locations found by multiple symlink hops.
Was the change discussed in an issue or in the forum before?
No.
Checklist