aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/sys/interface.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-09-24 13:26:30 +0900
committerOphestra <cat@gensokyo.uk>2025-09-24 13:37:38 +0900
commitb99c63337df4068b36d7d8de2ae79fd274172977 (patch)
tree81d2453857b7d6328db6545f096181b771c24cc3 /internal/sys/interface.go
parentf09133a224fabf2d16c7790654e39068cb59450f (diff)
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>
Diffstat (limited to 'internal/sys/interface.go')
-rw-r--r--internal/sys/interface.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/internal/sys/interface.go b/internal/sys/interface.go
index ed765ece..f2465e62 100644
--- a/internal/sys/interface.go
+++ b/internal/sys/interface.go
@@ -49,14 +49,8 @@ type State interface {
Uid(identity int) (int, error)
}
-// GetUserID obtains user id from hsu by querying uid of identity 0.
-func GetUserID(os State) (int, error) {
- if uid, err := os.Uid(0); err != nil {
- return -1, err
- } else {
- return (uid / 10000) - 100, nil
- }
-}
+// MustGetUserID obtains user id from hsu by querying uid of identity 0.
+func MustGetUserID(os State) int { return (MustUid(os, 0) / 10000) - 100 }
// CopyPaths is a generic implementation of [hst.Paths].
func CopyPaths(os State, v *hst.Paths, userid int) {