aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/system
AgeCommit message (Collapse)Author
2025-12-14internal/pipewire: handle SecurityContext::Create errorOphestra
This method can result in an error targeting it, so it is handled here. This change also causes a call to Create to also Core::Sync, as it should have done. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/outcome: populate instance metadata for PipeWireOphestra
These have similar semantics to equivalent Wayland security-context-v1 fields. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-09internal/pipewire: expose connection propsOphestra
Unused in hakurei but could be useful when the package is moved out of internal. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: integrate PipeWire SecurityContextOphestra
Tests for this Op happens to be the best out of everything due to the robust infrastructure offered by internal/pipewire. This is now ready to use in internal/outcome for implementing #26. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: optional op check parallelismOphestra
The PipeWire Op check cannot be made parallel due to the OS interaction. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: pass syscall error messageOphestra
This makes wrapped syscall errors produce a cleaner error message. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/system: remove ineffectual join reverting waylandOphestra
Removing the pathname socket used to be handled separately, now it is done during the Close call. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-19internal/wayland: clean up pathname socketOphestra
This is cleaner than cleaning up in internal/system as it covers the failure paths. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-16internal/wayland: reimplement connect/bind codeOphestra
The old implementation is relocated to system/wayland/deprecated.go. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-15internal/wayland: relocate connection structOphestra
This interface is getting replaced, so relocating it to the deprecated wrapper package before working on its replacement. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-15internal/wayland: improve error handlingOphestra
Note: wl_registry_add_listener is undocumented everywhere. Its implementation calls wl_proxy_add_listener which returns 0 on success or -1 on failure. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-15internal: relocate packagesOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-14treewide: migrate ldd callersOphestra
This discontinues use of the deprecated ldd.Exec function for #25. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-13internal/system: relocate from systemOphestra
These packages are highly specific to hakurei and are difficult to use safely from other pieces of code. Their exported symbols are made available until v0.4.0 where they will be removed for #24. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system: move out of internalOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system: wrap console output functionsOphestra
This eliminates all fmsg imports from internal/system. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system/wayland: sync file at caller specified addressOphestra
Storing this in sys is incredibly ugly: sys should be stateless and Ops must keep track of their state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system/tmpfiles: fail gracefully in API misuseOphestra
Panicking here leaves garbage behind. Not ideal if this package is going to be exported. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system/tmpfiles: implement private tmpfilesOphestra
These are only available within the mount namespace and should significantly reduce attack surface. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16fmsg: implement suspend in writerOphestra
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16system: separate link Op implementationOphestra
This Op would still be useful after replacing the Tmpfiles interface, so isolate it here. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-15app: improve WAYLAND_DISPLAY correctnessOphestra
This now has identical behaviour as wayland C library. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-15system: remove write mode tmpfilesOphestra
This interface is ugly and bug-prone. This change removes its write mode which has been obsoleted by CopyBind. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-13helper: use generic extra files interfaceOphestra
This replaces the pipes object and integrates context into helper process lifecycle. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-07system/dbus: dump messages on early faultOphestra
In the current app implementation this gets dumped in the wait method after resuming output. Wait is never called in an early fault condition, so any error messages get lost. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-07system/dbus: dump method prints msgbufOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-22dbus: enable syscall filterOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-22helper/bwrap: integrate seccomp into helper interfaceOphestra
This makes API usage much cleaner, and encapsulates all bwrap arguments in argsWt. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-27system/dbus: fix inverted system bus stateOphestra
Debug message and socket cleanup gets missed due to this value being inverted. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-20system: implement Enablements String methodOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-20migrate to git.gensokyo.uk/security/fortifyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-07system: prevent duplicate Wayland opOphestra Umiker
Wayland is implemented as an Op to enforce dependency and cleanup, its implementation does not allow multiple instances on a single sys object, nor would doing that make any sense. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-06system/wayland: integrate security-context-v1Ophestra Umiker
Had to pass the sync fd through sys. The rest are just part of a standard Op. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-03system/dbus: buffer xdg-dbus-proxy messagesOphestra Umiker
Pointing xdg-dbus-proxy to stdout/stderr makes a huge mess. This change enables app to neatly print out prefixed xdg-dbus-proxy messages after output is resumed. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-27system/dbus: compare sealed value by stringOphestra Umiker
Stringer method of dbus.Proxy returns a string representation of its args stream when sealed. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-25system: print number of ops completed at point of failureOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-25system: include more info in ACL StringerOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-23system: sys comparison methodOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-23system: return sys in queueing methodsOphestra Umiker
This enables building an instance in a single statement. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21fmsg: produce all output through fmsgOphestra Umiker
The behaviour of print functions from package fmt is not thread safe. Functions provided by fmsg wrap around Logger methods. This makes prefix much cleaner and makes it easy to deal with future changes to logging. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-20migrate to git.ophivana.moe/security/fortifyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17system: tests for all Op implementations except DBusOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17system/mkdir: type label in String methodOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17system: handle invalid enablement in String methodOphestra Umiker
Invalid enablement is only caused by bad API usage, however panicking on the spot leaves behind messy state that has to be manually cleaned up. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16system: move enablements from state packageOphestra Umiker
This removes the unnecessary import of the state package. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16system: isolate app/system into generic implementationOphestra Umiker
This improves maintainability and extensibility of system operations, makes writing tests for them possible, and operations now apply and revert in order, instead of being bunched up into their own categories. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-16final: refactor for removal of system package and reduction of interactions ↵Ophestra Umiker
to state package State query command has been moved to main where it belongs, "system" information are now fetched in app.New and stored in *App with accessors for relevant values. Exit (cleanup-related) functions are separated into its dedicated "final" package. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-12verbose: remove system package interactionOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-08clean up setup/launcher code and enable better control over sharesOphestra Umiker
In the past Wayland, X and PulseAudio are shared unconditionally. This can unnecessarily increase attack surface as some of these resources might not be needed at all. This commit moves all environment preparation code to the internal app package and selectively call them based on flags. An "enablements" bitfield is introduced tracking all enabled shares. This value is registered after successful child process launch and stored in launcher states. Code responsible for running the child process is isolated to its own app/run file and cleaned up. Launch method selection is also extensively cleaned up. The internal state/track readLaunchers function now takes uid as an argument. Launcher state is now printed using text/tabwriter and argv is only emitted when verbose. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-09-04rename to fortify and restructureOphestra Umiker
More sandbox features will be added and this will no longer track ego's features and behaviour. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>