Skip to content

Commit

Permalink
mount: make up volname if not given (macOS), fixes #7690
Browse files Browse the repository at this point in the history
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)".
  • Loading branch information
ThomasWaldmann committed Jun 30, 2023
1 parent de53164 commit 7c82969
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/borg/fuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def async_wrapper(fn):
from .item import Item
from .lrucache import LRUCache
from .platform import uid2user, gid2group
from .platformflags import is_darwin
from .remote import RemoteRepository


Expand Down Expand Up @@ -522,6 +523,13 @@ def pop_option(options, key, present, not_present, wanted_type, int_base=0):
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",
Expand Down

0 comments on commit 7c82969

Please sign in to comment.