You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using .. on an alias defined to point to a directory at top level of a remote operates on the local computer #4862
An Alias remote pointing to a subdirectory of the root on an S3 remote (i.e. pointing to an S3 bucket) lists the contents of my local computer's current directory when I do an rclone lsf MyAlias:..
I would expect instead that rclone lsf MyAlias:.. should behave like rclone lsf MyS3:MyBucket/.., i.e. it should list my buckets that are on the remote MyS3.
I reported this earlier today on the forum, in this thread:
I can replicate this - thank you for the bug report.
$ rclone lsf -vv s3rclone:..
2020/12/13 09:23:03 DEBUG : rclone: Version "v1.54.0-DEV" starting with parameters ["rclone" "lsf" "-vv" "s3rclone:.."]
2020/12/13 09:23:03 DEBUG : Using config file from "/home/ncw/.rclone.conf"
2020/12/13 09:23:03 DEBUG : Creating backend with remote "s3rclone:.."
2020/12/13 09:23:03 DEBUG : Creating backend with remote "."
2020/12/13 09:23:03 DEBUG : fs cache: renaming cache item "." to be canonical "/home/ncw"
2020/12/13 09:23:03 DEBUG : fs cache: renaming cache item "s3rclone:.." to be canonical "/home/ncw"
So the problem appears to be that rclone has normalised the path wrong...
I had a quick go at fixing this...
if myalias points to remote:dir
I guess we need to decide, do we want
myalias:.. == remote:
myalias:.. == remote:dir
I could make an argument for either... I did the most straight forward fix, but that turns out to be option 1 and I'm not sure that is what users expect of an alias.
Do we want the alias backend to cap the remote at the root passed in?
The same mechanism is used for the wrapping remotes, so do we expect a crypt backend to be able to look up? I think probably not.
I've decided that this should cap out at the root so if you set an
alias of s3:bucket then using alias:.. would not allow looking
above the root of the alias. Listing alias:.. now lists s3:bucket
as you might expect if you did cd / then ls ...
I think allowing alias:.. to look above the intended root is a
potential security problem waiting to happen. Witness lots of web
server data exfiltration due to use of ...
Activity
ncw commentedon Dec 13, 2020
I can replicate this - thank you for the bug report.
So the problem appears to be that rclone has normalised the path wrong...
I had a quick go at fixing this...
if
myaliaspoints toremote:dirI guess we need to decide, do we want
remote:remote:dirI could make an argument for either... I did the most straight forward fix, but that turns out to be option 1 and I'm not sure that is what users expect of an alias.
Do we want the alias backend to cap the remote at the root passed in?
The same mechanism is used for the wrapping remotes, so do we expect a crypt backend to be able to look up? I think probably not.
fs: Fix parsing of .. when joining remotes - Fixes -#4862 FIXME WIP
fs: Fix parsing of .. when joining remotes - Fixes #4862
ncw commentedon Dec 15, 2020
I've decided that this should cap out at the root so if you set an
alias of
s3:bucketthen usingalias:..would not allow lookingabove the root of the alias. Listing
alias:..now listss3:bucketas you might expect if you did
cd /thenls ...I think allowing
alias:..to look above the intended root is apotential security problem waiting to happen. Witness lots of web
server data exfiltration due to use of
...v1.54.0-beta.4970.7493dd856.fix-4862-fs-parse on branch fix-4862-fs-parse (uploaded in 15-30 mins)
ncw commentedon Dec 18, 2020
I've merged this to master now which means it will be in the latest beta in 15-30 mins and released in v1.54
alias: fix tests after parsing of ... change #4862
fs: Fix parsing of .. when joining remotes - Fixes rclone#4862
alias: fix tests after parsing of ... change rclone#4862