From 7c829697611349d268fdb855b6d7e7578e8ed203 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 30 Jun 2023 22:06:45 +0200 Subject: [PATCH] mount: make up volname if not given (macOS), fixes #7690 macFUSE supports a volname mount option to give what finder displays on desktop / in directory list. if the user did not specify it, we make something up, because otherwise it would be "macFUSE Volume 0 (Python)". --- src/borg/fuse.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/borg/fuse.py b/src/borg/fuse.py index e2ef8eaa9..d124d2544 100644 --- a/src/borg/fuse.py +++ b/src/borg/fuse.py @@ -40,6 +40,7 @@ from .helpers import msgpack from .item import Item from .lrucache import LRUCache from .platform import uid2user, gid2group +from .platformflags import is_darwin from .remote import RemoteRepository @@ -522,6 +523,13 @@ class FuseOperations(llfuse.Operations, FuseBackend): options = ['fsname=borgfs', 'ro', 'default_permissions'] if mount_options: options.extend(mount_options.split(',')) + if is_darwin: + # macFUSE supports a volname mount option to give what finder displays on desktop / in directory list. + volname = pop_option(options, 'volname', '', '', str) + # if the user did not specify it, we make something up, + # because otherwise it would be "macFUSE Volume 0 (Python)", #7690. + volname = volname or f"{os.path.basename(mountpoint)} (borgfs)" + options.append(f"volname={volname}") ignore_permissions = pop_option(options, 'ignore_permissions', True, False, bool) if ignore_permissions: # in case users have a use-case that requires NOT giving "default_permissions",