aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2025-10-25internal/app/state: include et headerOphestra
This is the initial step of implementing #19. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-25internal/app/state: use internal/lockedfileOphestra
This is a pretty solid implementation backed by robust tests, with a much cleaner interface. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-25internal/app/state: export correct backend valueOphestra
This references the underlying multiBackend due to a typo, making the whole dance with c a noop. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-25container/executable: handle nil msgOphestra
This is useful in some tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-25internal/app/state: fixed size et-only headerOphestra
This header improves the robustness of the format and significantly reduces cleanup overhead. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-24cmd/hakurei: short identifier from lower halfOphestra
The upper half is now a nanosecond timestamp. Lower half is still random bytes, so use lower half for short identifier. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-24hst/instance: embed config structOphestra
This makes the resulting json easier to parse since it can now be deserialised into the config struct. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23hst/instance: store priv side pidOphestra
This can receive signals, so is more useful to the caller. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23hst/instance: define instance stateOphestra
This is now part of the hst API. This change also improves identifier generation and serialisation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23container/init: do not suspend outputOphestra
Init is not very talkative after process start even when verbose. Suspending output here is pointless and does more harm than good. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23container/init: improve signal handlingOphestra
The SIGTERM signal is delivered in many other cases and can lead to strange behaviour. The unconditional resume of the logger also causes strange behaviour in the cancellation forwarding path. This change also passes through additional signals. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23internal/app/shim: check behaviourOphestra
This does not yet have full coverage. Test cases covering failsafe paths and error injection will be added eventually. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23internal/app: test case for hst templateOphestra
This helps with other areas of the test suite as they're all based on hst.Template. This also helps contributors understand the behaviour of internal/app as hst.Template covers almost every aspect of it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-23cmd/hsu: reduce excessive test rangeOphestra
This is quite a simple piece of code, this many test cases is excessive and wastes time in the integration vm. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22internal/app: reduce test case indentationOphestra
This improves readability on narrower displays. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22internal/app/shim: use syscall dispatcherOphestra
This enables instrumented testing of the shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22container/syscall: export prctl wrapperOphestra
This is useful as package "syscall" does not provide such a wrapper. This change also improves error handling to fully conform to the manpage. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22cmd/hsu: run in locked threadOphestra
Goroutine scheduling is not helpful in the setuid wrapper, it is not particularly harmful but lock here anyway. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-22container/init: check msg in entrypointOphestra
This covers invalid call to Init. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21container/comp: rename from bitsOphestra
This package will also hold syscall lookup tables for seccomp. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21hst/container: flags string representationOphestra
This is useful for a user-facing representation other than JSON. This also gets rid of the ugly, outdated flags string builder in cmd/hakurei. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21test: assert hst CGO_ENABLED=0Ophestra
The hst package only deals with data serialisation, however since many parts of hakurei make use of C libraries in some way it can be easy to inadvertently depend on cgo. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21cmd/hakurei/parse: close config fdOphestra
This is cleaner than relying on the finalizer. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21test/interactive/trace: update nix attributeOphestra
Updated according to evaluation warning. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21cmd/hakurei/json: friendly error messagesOphestra
This change handles errors returned by encoding/json and prints significantly cleaner messages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21container/init: check use constants for open flagsOphestra
These bits are arch-specific. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21container/syscall: dot-import syscallOphestra
This avoids having arch-specific constants for arm64. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21hst: expose version stringOphestra
The hst API is tied to this version string. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21internal: clean up build stringsOphestra
These names are less ambiguous and should be understandable without reading the source code. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19hst/container: optional runtime and tmpdir sharingOphestra
Sharing and persisting these directories do not always make sense. Make it optional here. Closes #16. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19test: place marker in common pathOphestra
This discontinues the dependency on shared tmpdir and xdg_runtime_dir implementation detail, for #16. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19internal/app: remove spfinalOphestra
This no longer needs to be an independent outcomeOp since spFilesystemOp is moved late. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19hst/config: validate env earlyOphestra
This should happen in hst since it requires no system state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19internal/app/outcome: apply configured filesystems lateOphestra
This enables configured filesystems to cover system mount points. Closes #8. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19internal/app/spx11: check behaviourOphestra
This outcomeOp will likely never change. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-19internal/app/spwayland: check behaviourOphestra
This op is quite clean. Might get slightly more complex at some point passing socket fd. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/dispatcher: report correct fieldOphestra
This was mistakenly reporting sharePath on inequivalence causing very confusing output. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/sptmpdir: check behaviourOphestra
Another simple one. This will change when shared tmpdir and xdg runtime dir becomes optional. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/hsu: check behaviourOphestra
The stub exec.ExitError is hairy as usual, but internal/app is not cross-platform, so this is okay. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18ldd/exec: raise timeoutOphestra
This mostly helps with tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/hsu: remove wrapper methodOphestra
This was added to reduce the size of diffs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/spruntime: emulate pam_systemd typeOphestra
This sets XDG_SESSION_TYPE to the corresponding values specified in pam_systemd(8) according to enablements. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/spruntime: check behaviourOphestra
This one is quite simple and has no state. Needs to emulate pam_systemd behaviour so that will change. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/sppulse: check cookie discoveryOphestra
There's quite a bit of code duplication here, but since this is already quite simple it is best to leave it as is for now. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-18internal/app/sppulse: check buf error injectionOphestra
The loadFile behaviour does not guarantee the buffer to be zeroed or not clobbered if an error is returned, but for the current implementation it is good to check. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-17internal/app/sppulse: correctly handle small cookieOphestra
The trailing zero bytes need to be sliced off, so send cookie size alongside buffer content. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-17internal/app/sppulse: check behaviourOphestra
Still needs to check the relocated functions separately. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-17internal/app/dispatcher: reduce check code duplicationOphestra
This also improves readability of test cases. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-16internal/app/sppulse: relocate hard to test codeOphestra
These are better tested separately instead of creating many op test cases. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-16internal/app/spfinal: check behaviourOphestra
This will be merged with spFilesystemOp eventually. Signed-off-by: Ophestra <cat@gensokyo.uk>