aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2025-11-12release: 0.3.1v0.3.1Ophestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-12container: set FD_CLOEXEC on all open filesOphestra
While fd created from this side always has the FD_CLOEXEC flag, the same is not true for files left open by the parent. This change prevents those files from leaking into the container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-11container/init: close setup pipe earlyOphestra
This prevents leaking the setup pipe. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-10container/init: close initial process files on terminationOphestra
This closes them during the adopt wait delay. This also keeps them alive. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-10treewide: reject impossible user-supplied fdOphestra
These are all trusted user input, however this check reduces the likelihood of hard to debug errors. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-10cmd/hakurei: expose current instance identifierOphestra
This writes the 16-byte instance identifier to file descriptor specified by --identifier-fd if set, and closes the file. This enables safely obtaining the new instance's identifier. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-09internal/outcome: handle group lookup messageOphestra
This results in slightly less messy error reporting. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-09nix: update names to reflect new terminologyOphestra
These are terminology from way early days. Update them now to be less confusing. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-07container/std/seccomp: remove ineffectual typecastOphestra
This is no longer necessary since the return type changed. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-07container/seccomp/presets: add fields to literalsOphestra
This keeps composites analysis happy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-07std: separate seccomp constantsOphestra
This avoids inadvertently using PNRs as syscall numbers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-06release: 0.3.0v0.3.0Ophestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-06container/std: syscall JSON adapterOphestra
This provides cross-platform JSON adapter for syscall number. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05container: add 386 constantsOphestra
While it is unlikely a use case for hakurei on i686 exists, it does not hurt to have this support. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05treewide: fit test untyped int literals in 32-bitOphestra
This enables hakurei test suite to run on 32-bit targets. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05container/std: relocate rule typesOphestra
This enables its use in hst for #15. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05container/seccomp: use native typesOphestra
This prepares NativeRule for relocation to std for #15. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05container/seccomp: alias libseccomp typesOphestra
This enables tests to refer to these types and check its size. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05std: relocate seccomp lookup tablesOphestra
This should enable resolving NativeRule in hst. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05container/seccomp/pnr: define pseudo syscallsOphestra
This eliminates the cgo dependency from syscall lookup. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05std: rename from compOphestra
Seccomp lookup tables are going to be relocated here, and PNR constants. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05hst/grp_pwd: add extra test casesOphestra
Does not change coverage but this helps me crosscheck with my phone. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-04hst/grp_pwd: specify new uid formatOphestra
This leaves slots available for additional uid ranges in Rosa OS. This breaks all existing installations! Users are required to fix ownership manually. Closes #18. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03cmd/hakurei/print: handle nil configOphestra
There is nothing to print in this case, and such a nil check is missing. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03cmd/hpkg/test: print share directoryOphestra
This is more useful now that state is tracked here. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03message: rename NewMsg to NewOphestra
Should have done this when relocating this from container. Now is a good time to rename it before v0.3.x. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03internal/store: remove compat adapterOphestra
This is no longer used as everything has been migrated. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03hst/config: make identifier omitemptyOphestra
This is an optional field. Serialise it as such. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03cmd/hakurei/print: use new store interfaceOphestra
This removes the final uses of the compat interfaces. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02test: print share directoryOphestra
This is more useful now that state is tracked here. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02cmd/hakurei/print: serialise array for psOphestra
Wanted to do this for a long time, since the key is redundant. This also makes it easier to migrate to the new store interface. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02cmd/hakurei/parse: use new store interfaceOphestra
This greatly reduces overhead. The iterator also significantly cleans up the usage code. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/store: iterator over all entriesOphestra
This is quite convenient for searching the store or printing active instance information. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome: track state in TMPDIROphestra
The SharePath is a more stable path than RunDirPath, since it is available all the time and should remain consistent. This also fits better into the intended use case of XDG_RUNTIME_DIR. Closes #17. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/env: cleaner runtime dir fallbackOphestra
This now places rundir inside the fallback runtime dir, so special case in internal/outcome is avoided. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome/shim: cover reparent and exit request pathsOphestra
These test cases were missed when making the changes. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome/process: nil-safe unlock when failing to lockOphestra
This also prints a debug message which might be useful. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome: measure finalise timeOphestra
This also increases precision of state time output. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome/shim: EOF as exit request fallbackOphestra
In some cases the signal might be delivered before the signal handler is installed, and synchronising against such a case is too expensive. Instead, use the pipe being closed as a fallback to the regular exit request. This change also moves installation of the signal handler early. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-02internal/outcome/process: use new store interfaceOphestra
This change also spawns shim before committing system state, leaving it blocking on the setup pipe. The internal/outcome/process structure is also entirely reworked to be much more readable and less error-prone, while enabling basic performance measurements. A long-standing bug where segment lock is not held during Commit is also resolved. Closes #19. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-01internal/outcome/process: relocate start and serveOphestra
This is useful for reordering these operations for further cleanup. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-31internal/outcome: remove guard on mainOphestra
This is no longer exported. Such a check is pointless. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-31container/params: expose pipeOphestra
This increases flexibility of how caller wants to handle the I/O. Also makes it no longer rely on finalizer. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-31internal/store: expose save via handleOphestra
The handle is otherwise inaccessible without the compat interface. This change also moves compatibility methods to separate adapter structs to avoid inadvertently using them. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-31internal/store: export new interfaceOphestra
This exposes store operations safe for direct access, and enables #19 to be implemented in internal/outcome. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-30internal/store: rename compat interfaceOphestra
The new store implementation will be exported as Store. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-30internal/store: rename from stateOphestra
This reduces collision with local variable names, and generally makes sense for the new store package, since it no longer specifies the state struct. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-30internal/outcome/shim: check full behaviourOphestra
This took significant effort to stub out, and achieves full coverage after c5aefe5e9d. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-30internal/outcome/process: output via msgOphestra
This makes it possible to instrument output behaviour through stub. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-30internal/outcome/shim: move signal constantsOphestra
The magic numbers hurt readability. Signed-off-by: Ophestra <cat@gensokyo.uk>