Foxboron / sbctl

:computer: :lock: :key: Secure Boot key manager
MIT License
1.46k stars 82 forks source link

[bug] `sbctl create-keys --config ./sbctl.conf` ignores custom config-path #370

Open HidingCherry opened 1 month ago

HidingCherry commented 1 month ago

Title sums it up.

strace show me that sbctl doesn't even try to read the config path.

$ strace sbctl create-keys --config ./sbctl.conf 2>&1 | grep sbctl.conf
execve("/sbin/sbctl", ["sbctl", "create-keys", "--config", "./sbctl.conf"], 0x7ffdee50a3a8 /* 89 vars */) = 0
newfstatat(AT_FDCWD, "/etc/sbctl/sbctl.conf", 0xc000200928, 0) = -1 ENOENT (No such file or directory)

OS: archlinux package:

$ pacman -Qi sbctl
Name            : sbctl
Version         : 0.15.4-1.1
Description     : Secure Boot key manager
Architecture    : x86_64
URL             : https://github.com/Foxboron/sbctl
Licenses        : MIT
Groups          : None
Provides        : None
Depends On      : binutils  util-linux
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 8,77 MiB
Packager        : ALHP x86-64-v3 <alhp@harting.dev>
Build Date      : Do 08 Aug 2024 05:38:45 CEST
Install Date    : Do 29 Aug 2024 22:07:22 CEST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : SHA-256 Sum  Signature
Foxboron commented 1 month ago

Right. I missed this.

But now I'm realizing that the internal building of the configuration is a bit scuffed with how I have wired up stuff in cobra so this needs a bit more thought.