2489766efe
hst/config: identity bounds check early
...
This makes sense to do here instead of in internal/app.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-07 17:58:28 +09:00
9e48d7f562
hst/config: move container fields from toplevel
...
This change also moves pd behaviour to cmd/hakurei, as this does not belong in the hst API.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-07 04:24:45 +09:00
f280994957
internal/app: check nscd socket for path hiding
...
This can seriously break things, and exposes extra host attack surface, so include it here.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 20:47:30 +09:00
ae7b343cde
hst: reword and move constants
...
These values are considered part of the stable, exported API, so move them to hst.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 17:40:32 +09:00
a63a372fe0
internal/app: merge static stub
...
These tests now serve as integration tests, and finer grained tests for each op will be added slowly.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 17:15:14 +09:00
16f9001f5f
hst/config: update doc comments
...
Some information here are horribly out of date. This change updates and improves all doc comments.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 04:12:53 +09:00
80ad2e4e23
internal/app: do not offset base value
...
This value is applied to the shim, it is incorrect to offset the base value as well.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 03:59:52 +09:00
92b83bd599
internal/app: apply pd behaviour to outcomeState
...
This avoids needlessly clobbering hst.Config.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 03:53:23 +09:00
8ace214832
system/wayland: hang up security-context-v1 internally
...
This should have been an implementation detail and should not be up to the caller to close.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 03:25:13 +09:00
eb5ee4fece
internal/app: modularise outcome finalise
...
This is the initial effort of splitting up host and container side of finalisation for params to shim. The new layout also enables much finer grained unit testing of each step, as well as partition access to per-app state for each step.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-05 02:52:50 +09:00
9462af08f3
system/dbus: dump buffer internally
...
This should have been an implementation detail and should not be up to the caller to call it.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-04 20:31:14 +09:00
a5f0aa3f30
internal/app: declutter and merge small files
...
This should make internal/app easier to work with for the upcoming params to shim.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-03 16:59:29 +09:00
dd0bb0a391
internal/app: check username validation
...
This stuff should be hardcoded in libc, but check it anyway.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-03 16:42:42 +09:00
d16da6da8c
system: enforce absolute paths
...
This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute.
Closes #11 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-03 02:26:14 +09:00
e58181a930
internal/app/paths: defer extra formatting
...
This reduces payload size for params to shim.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-30 00:21:26 +09:00
71e70b7b5f
internal/app/paths: do not print messages
...
This change was missed while merging the rest of the logging changes.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-29 09:30:57 +09:00
afa1a8043e
helper/proc: raise FulfillmentTimeout in tests
...
This appears to be yet another source of spurious test failures.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-29 07:44:33 +09:00
1ba1cb8865
hst/config: remove seccomp bit fields
...
These serve little purpose and are not friendly for use from other languages.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-29 07:07:16 +09:00
44ba7a5f02
hst/enablement: move bits from system
...
This is part of the hst API, should not be in the implementation package.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-29 06:34:29 +09:00
dc467493d8
internal: remove hlog
...
This package has been fully replaced by container.Msg.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-29 06:21:04 +09:00
46cd3a28c8
container: remove global msg
...
This frees all container instances of side effects.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-29 06:11:47 +09:00
ad1bc6794f
release: 0.2.2
...
Unfortunately removal of internal/hlog brought about some changes that breaks API. This will likely be the last 0.2.x release.
Signed-off-by: Ophestra <cat@gensokyo.uk >
v0.2.2
2025-09-28 21:58:19 +09:00
e55822c62f
container/init: reduce verbose noise
...
This makes it possible to optionally omit the identifying verbose message, for when the Op implementation can provide a much more useful message in its case, using information not yet available to the String method.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-28 21:51:10 +09:00
802e6afa34
container/output: move global output to msg
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-27 19:55:37 +09:00
e906cae9ee
container/output: export suspendable writer
...
This is quite useful for other packages as well. This change prepares internal/hlog for removal.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-27 19:46:35 +09:00
ae2df2c450
internal: remove sys package
...
This package is replaced by container/stub. Remove and replace it with unexported implementation for the upcoming test suite rewrite.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-25 13:51:54 +09:00
6e3f34f2ec
internal/app: merge finalise test cases
...
This cleans everything up a bit for the upcoming test suite rewrite.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-25 12:11:02 +09:00
65a0bb9729
internal/sys/hsu: expose hsurc identifier
...
This maintains a compatible interface for now, to ease merging of the upcoming changes to internal/app.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-24 21:17:04 +09:00
afa7a0800d
cmd/hsu: return hsurc id
...
The uid format is stable, this value is what caller has to obtain through hsu.
Closes #14 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-24 21:10:13 +09:00
773253fdf5
test/sandbox: raise timeout
...
The integration vm is being very slow for some reason. This change should reduce spurious timeouts.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-24 19:41:59 +09:00
409ed172c8
internal/app: handle LookupGroup error
...
This could return errnos from the cgo calls.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-24 19:36:55 +09:00
1c4f593566
internal/app: unexport outcome, remove app struct
...
The App struct no longer does anything, and the outcome struct is entirely opaque.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-24 18:44:14 +09:00
b99c63337d
internal/app: do not return from shim start
...
The whole RunState ugliness and the other horrendous error handling conditions for internal/app come from an old design proposal for maintaining all app containers under the same daemon process for a user. The proposal was ultimately rejected but the implementation remained. It is removed here to alleviate internal/app from much of its ugliness and unreadability.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-24 13:37:38 +09:00
f09133a224
test: check init lingering timeout behaviour
...
This checks init timeout on lingering process after initial process termination.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-22 21:56:29 +09:00
16409b37a2
internal/app: compensate shim timeout
...
This catches cases where the shim has somehow locked up, so it should wait out the full shim WaitDelay as well.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-16 02:23:19 +09:00
a2a291791c
internal/sys: separate hsu uid cache
...
This begins the effort of the removal of the sys package.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-15 02:30:47 +09:00
8690419c2d
hst: replace internal/app error
...
This turns out to still be quite useful across internal/app and its relatives. Perhaps a cleaner replacement for baseError.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-15 01:44:43 +09:00
1cdc6b4246
test/sandbox: create marker in /var/tmp
...
This prepares the test suite for private TMPDIR.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-14 16:45:17 +09:00
56aad8dc11
test/sandbox/tool: marker pathname from flag
...
Since this is going to be placed in a shared directory, it needs to be unique to the identity. Instead of trying to figure out identity from mountinfo, just have the test script pass hardcoded values.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-14 15:57:41 +09:00
83c4f8b767
test/sandbox: check extra writable paths
...
This is not always obvious from mountinfo.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-14 15:12:51 +09:00
d0ddd71934
test/sandbox: bind /var/tmp writable
...
This makes it possible to place markers with private tmpdir.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-14 14:59:53 +09:00
70e02090f7
nix: use slightly less ambiguous type
...
I had trouble getting Nix to merge json arrays properly, I am not sure that this helps.
At this point I have given up trying to understand Nix type system, and I am just trying to keep the Nix stuff going with extensive tests until it can be replaced by lkl for testing and planterette for general usage.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-14 14:45:14 +09:00
ca247b8037
internal/app: mount /dev/shm early
...
This avoids covering /dev/shm mounts from hst.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-14 01:49:42 +09:00
3f25c3f0af
container: initialise cmd early
...
This allows use of more cmd methods.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-13 20:01:33 +09:00
e271fa77aa
nix: update flake lock
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-13 12:07:57 +09:00
f876043844
internal/hlog: remove error wrapping
...
This was a stopgap solution that lasted for way too long. This finally removes it and prepares internal/app for some major changes.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-12 06:52:35 +09:00
6265aea73a
system: partial I inherit dispatcher
...
This enables I struct methods to be checked.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-11 02:02:31 +09:00
c8a0effe90
system/wayland: use syscall dispatcher
...
This enables wayland op methods to be instrumented.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-11 01:48:18 +09:00
8df01b71d4
system: remove test package
...
This prepares the Commit and Revert methods for testing via stub.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-10 23:50:22 +09:00
985c4dd2fc
system/xhost: wrap revert error correctly
...
This otherwise creates a confusing error message on a revert failure.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-09-08 04:17:39 +09:00