From a78bc093de82358143719e63e771e099db91d242 Mon Sep 17 00:00:00 2001 From: divinity76 Date: Fri, 6 Dec 2024 09:14:09 +0100 Subject: [PATCH] cmd/mountlib: better snap mount error message Mounting will always fail when rclone is installed from the snap package manager. But the error message generated when trying to mount from a snap install was not very good. Improve the error message. Fixes #8208 --- cmd/mountlib/mount.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go index 275d5a434..3a3039c16 100644 --- a/cmd/mountlib/mount.go +++ b/cmd/mountlib/mount.go @@ -373,6 +373,9 @@ func (m *MountPoint) Mount() (mountDaemon *os.Process, err error) { m.ErrChan, m.UnmountFn, err = m.MountFn(m.VFS, m.MountPoint, &m.MountOpt) if err != nil { + if len(os.Args) > 0 && strings.HasPrefix(os.Args[0], "/snap/") { + return nil, fmt.Errorf("mounting is not supported when running from snap") + } return nil, fmt.Errorf("failed to mount FUSE fs: %w", err) } m.MountedOn = time.Now()