cmd/sharefs: handle mount -t fuse.sharefs
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / ShareFS (push) Successful in 39s
Test / Sandbox (push) Successful in 46s
Test / Sandbox (race detector) (push) Successful in 45s
Test / Hpkg (push) Successful in 49s
Test / Hakurei (push) Successful in 54s
Test / Hakurei (race detector) (push) Successful in 55s
Test / Flake checks (push) Successful in 1m35s

This should have been handled in a custom option parsing function, but that much extra complexity is unnecessary for this edge case. Honestly I do not know why libfuse does not handle this itself.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-12-27 20:49:27 +09:00
parent 775a9f57c9
commit ef1ebf12d9
3 changed files with 48 additions and 4 deletions

View File

@@ -314,7 +314,7 @@ func _main(s ...string) (exitCode int) {
// hack to keep fuse_parse_cmdline happy in the container
mountpoint := C.GoString(opts.mountpoint)
pathnameArg := -1
for i, arg := range os.Args {
for i, arg := range s {
if arg == mountpoint {
pathnameArg = i
break
@@ -324,7 +324,7 @@ func _main(s ...string) (exitCode int) {
log.Println("mountpoint must be absolute")
return 2
}
os.Args[pathnameArg] = container.Nonexistent
s[pathnameArg] = container.Nonexistent
}
if !parseOpts(&args, &setup, msg.GetLogger()) {
@@ -421,7 +421,7 @@ func _main(s ...string) (exitCode int) {
} else {
z.Path = a
}
z.Args = os.Args
z.Args = s
z.ForwardCancel = true
z.SeccompPresets |= std.PresetStrict
z.ParentPerm = 0700