diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-09-04 01:20:12 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-09-04 01:20:12 +0900 |
| commit | d8f76f3b2594db4687c0203c4f2be8d3e4ef7740 (patch) | |
| tree | b1d8bfb5250d71094e397f8afa87710de1f1ca2f /internal/system/retrieve.go | |
| parent | 7e6eb82195c650bc34829e5cca2d2296e78c0707 (diff) | |
rename to fortify and restructure
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>
Diffstat (limited to 'internal/system/retrieve.go')
| -rw-r--r-- | internal/system/retrieve.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/system/retrieve.go b/internal/system/retrieve.go new file mode 100644 index 00000000..d9f0e3dd --- /dev/null +++ b/internal/system/retrieve.go @@ -0,0 +1,28 @@ +package system + +import ( + "fmt" + "os" + "path" + "strconv" +) + +func Retrieve(verbose bool) { + if V != nil { + panic("system info retrieved twice") + } + + v := &Values{Share: path.Join(os.TempDir(), "fortify."+strconv.Itoa(os.Geteuid())), Verbose: verbose} + + if r, ok := os.LookupEnv(xdgRuntimeDir); !ok { + fmt.Println("Env variable", xdgRuntimeDir, "unset") + + // too early for fatal + os.Exit(1) + } else { + v.Runtime = r + v.RunDir = path.Join(v.Runtime, "fortify") + } + + V = v +} |
