diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-12-19 11:14:31 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-12-19 11:14:31 +0900 |
| commit | 5d25bee7869e5ecec20e9bddc9f27d9b4a0b0988 (patch) | |
| tree | c0d7ef24693531592b56e10515a45e104d345a48 /internal/linux/std.go | |
| parent | b48ece3bb0ac347a456e23851ba5505786891d8b (diff) | |
fortify: remove systemd check
This is no longer necessary as fortify no longer integrates with external user switchers.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/linux/std.go')
| -rw-r--r-- | internal/linux/std.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/internal/linux/std.go b/internal/linux/std.go index 4ea5b903..61864bed 100644 --- a/internal/linux/std.go +++ b/internal/linux/std.go @@ -1,7 +1,6 @@ package linux import ( - "errors" "io" "io/fs" "os" @@ -19,9 +18,6 @@ type Std struct { paths Paths pathsOnce sync.Once - sdBooted bool - sdBootedOnce sync.Once - uidOnce sync.Once uidCopy map[int]struct { uid int @@ -90,31 +86,3 @@ func (s *Std) Uid(aid int) (int, error) { return u.uid, u.err } } - -func (s *Std) SdBooted() bool { - s.sdBootedOnce.Do(func() { s.sdBooted = copySdBooted() }) - return s.sdBooted -} - -const systemdCheckPath = "/run/systemd/system" - -func copySdBooted() bool { - if v, err := sdBooted(); err != nil { - fmsg.Println("cannot read systemd marker:", err) - return false - } else { - return v - } -} - -func sdBooted() (bool, error) { - _, err := os.Stat(systemdCheckPath) - if err != nil { - if errors.Is(err, fs.ErrNotExist) { - err = nil - } - return false, err - } - - return true, nil -} |
