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.
What is your rclone version (output from rclone version)
1.53.3
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Windows 10 64 bit
Which cloud storage system are you using? (eg Google Drive)
Amazon S3
The command you were trying to run (eg rclone copy /tmp remote:tmp)
I did it on a Windows box. I don't have a Linux box to try it on, but I just now tried it on a FreeBSD box, and got the same behavior as I did on Windows.
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?
This same mechanism is used for crypt/cache/etc wrapping - I think we probably don't want crypt:.. to be able to look at the directory above.
I know you didn't ask me (and I don't blame you ), but for what it's worth, I would expect it to behave the same way I would expect something similar on a local filesystem to behave. For example, on FreeBSD (and I think on Linux too, but I don't have a Linux box here to verify it on), if you do an ln -s /etc etclink, then ls etclink, it will show you the contents of /etc. If you then do a ls etclink/.., it will show you the contents of / -- NOT the contents of /etc.
I don't really care one way or the other, but I'd be surprised to discover it didn't work like that.
Making things consistent is important and that analogy with symlinks is a good one.
I guess this could be a config option for alias also which stops viewing above the root.
I'm more concerned with the crypt wrapping though, as if I implement option 1) above the crypt:.. will start decrypting the directory above which maybe is OK or maybe not!
This is a tough one as I think there really isn't a use for doing ".." on a root of a directory as it just seems odd.
If ls /.. on the root, it stops and gives you the the current directory.
If you ls /test/.. with /test linking to something like /home/felix/test, it does follow it and you one back.
For my brain, I think of the remote as / in the equation and any alias I create as the same so I would think it should not show me anything before as that's why I created the alias.
So I would side on stopping viewing above the root.
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 ...