You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up to #557. I would like to know if the proposed changes are acceptable.
The -ko volname=XXX does not work, because gocryptfs sets volname to directory base name of the mountpoint first, then expect to override it with duplicate option-value pair. Relevant codes:
// Add additional mount options (if any) after the stock ones, so the user has
// a chance to override them.
ifargs.ko!="" {
parts:=strings.Split(args.ko, ",")
tlog.Debug.Printf("Adding -ko mount options: %v", parts)
mOpts.Options=append(mOpts.Options, parts...)
}
Basically, it would produce -o volname=BaseNameOfMountPoint,volname=CustomVolName option for macFUSE.
This appears logical at first glance, but it doesn't work as expected. macFUSE only reads the initial volname value set by gocryptfs and does not check for updates to this option later on.
I swapped these two code blocks and test on macOS Sonoma and it works as expected, the volname option can now be overridden correctly.
I think it's worth rewriting this part of gocryptfs so it only sets each option exactly once - use only user-provided option if possible, only inject stock options if they are not provided.
The text was updated successfully, but these errors were encountered:
JokerQyou
added a commit
to JokerQyou/gocryptfs
that referenced
this issue
Jun 15, 2024
Merge stock kernel options with user-provided ones before passing to go-fuse.
Before: `-ko volname=custom` would result in `-o volname=mountpoint,volname=custom` to macFUSE.
After: `-ko volname=custom` would produce `-o volname=custom` with no duplicates.
Fixesrfjakob#854 and rfjakob#557
Merge stock kernel options with user-provided ones before passing to go-fuse.
Before: `-ko volname=custom` would result in `-o volname=mountpoint,volname=custom` to macFUSE.
After: `-ko volname=custom` would produce `-o volname=custom` with no duplicates.
Fixes#854 and #557
This is a follow-up to #557. I would like to know if the proposed changes are acceptable.
The
-ko volname=XXX
does not work, because gocryptfs setsvolname
to directory base name of the mountpoint first, then expect to override it with duplicate option-value pair. Relevant codes:gocryptfs/mount.go
Lines 437 to 442 in f06f27e
gocryptfs/mount.go
Lines 467 to 473 in f06f27e
Basically, it would produce
-o volname=BaseNameOfMountPoint,volname=CustomVolName
option for macFUSE.This appears logical at first glance, but it doesn't work as expected. macFUSE only reads the initial
volname
value set by gocryptfs and does not check for updates to this option later on.I swapped these two code blocks and test on macOS Sonoma and it works as expected, the
volname
option can now be overridden correctly.I think it's worth rewriting this part of gocryptfs so it only sets each option exactly once - use only user-provided option if possible, only inject stock options if they are not provided.
The text was updated successfully, but these errors were encountered: