Merge pull request #7696 from ThomasWaldmann/macfuse-volname-master

mount: make up volname if not given (macOS), fixes #7690
This commit is contained in:
TW 2023-07-01 16:02:28 +02:00 committed by GitHub
commit cd678a032d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,7 @@ from .helpers import msgpack
from .helpers.lrucache import LRUCache
from .item import Item
from .platform import uid2user, gid2group
from .platformflags import is_darwin
from .remote import RemoteRepository
@ -513,6 +514,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",