mount: fix mount failure on macOS with on the fly remote

This commit

3567a47258 fs: make ConfigString properly reverse suffixed file systems

made fs.ConfigString() return the full config of the backend. Because
mount was using this to make a volume name it started to make volume
names with illegal characters in which couldn't be mounted by macOS.

This fixes the problem by making a separate fs.ConfigStringFull() and
using that where appropriate and leaving the original
fs.ConfigString() function untouched.

Fixes #7063
See: https://forum.rclone.org/t/1-63-beta-fails-to-mount-on-macos-with-on-the-fly-crypt-remote/39090
This commit is contained in:
Nick Craig-Wood 2023-06-20 17:38:17 +01:00
parent 22d6c8d30d
commit 2c50f26c36
3 changed files with 24 additions and 7 deletions

View file

@ -318,7 +318,7 @@ func (f *Fs) InternalTestVersions(t *testing.T) {
// Check we can make a NewFs from that object with a version suffix
t.Run("NewFs", func(t *testing.T) {
newPath := bucket.Join(fs.ConfigString(f), fileNameVersion)
newPath := bucket.Join(fs.ConfigStringFull(f), fileNameVersion)
// Make sure --s3-versions is set in the config of the new remote
fs.Debugf(nil, "oldPath = %q", newPath)
lastColon := strings.LastIndex(newPath, ":")
@ -330,7 +330,7 @@ func (f *Fs) InternalTestVersions(t *testing.T) {
require.Equal(t, fs.ErrorIsFile, err)
require.NotNil(t, fNew)
// With the directory the directory above
assert.Equal(t, dirName, path.Base(fs.ConfigString(fNew)))
assert.Equal(t, dirName, path.Base(fs.ConfigStringFull(fNew)))
})
})