diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-02-28 20:42:33 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-02-28 20:44:44 +0900 |
| commit | c74c269b66770f0eddde255d2805b79f274409e9 (patch) | |
| tree | 02cb3e1bed01d24776d8d47a9c8fca47ed3d7343 /cmd/sharefs | |
| parent | 4b0cce4db5f8e75c79e104f8c5ec02cb4541ed76 (diff) | |
container: use /proc/self/exe directly
This is a more reliable form of pathname to self and also cheaper than os.Executable.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/sharefs')
| -rw-r--r-- | cmd/sharefs/fuse.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd/sharefs/fuse.go b/cmd/sharefs/fuse.go index d35ff8b9..a52ee035 100644 --- a/cmd/sharefs/fuse.go +++ b/cmd/sharefs/fuse.go @@ -33,6 +33,7 @@ import ( "hakurei.app/container" "hakurei.app/container/check" + "hakurei.app/container/fhs" "hakurei.app/container/std" "hakurei.app/hst" "hakurei.app/internal/helper/proc" @@ -441,12 +442,7 @@ func _main(s ...string) (exitCode int) { // keep fuse_parse_cmdline happy in the container z.Tmpfs(check.MustAbs(container.Nonexistent), 1<<10, 0755) - if a, err := check.NewAbs(container.MustExecutable(msg)); err != nil { - log.Println(err) - return 5 - } else { - z.Path = a - } + z.Path = fhs.AbsProcSelfExe z.Args = s z.ForwardCancel = true z.SeccompPresets |= std.PresetStrict |
