aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-25 12:14:57 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-25 12:14:57 +0900
commit3b82cc55dea66c9c404c73b010203fd6a2c38cdb (patch)
tree6446be6184408d627ae41ca2b63b07394527bf44
parent6bc5be7e5a2334274adf2945ad6d29d063a7086b (diff)
internal: use fallback paths when XDG_RUNTIME_DIR is not absolute
There are scenarios where XDG_RUNTIME_DIR is set to an empty string or garbage. This check tries to ensure reasonable behaviour in most of those cases. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
-rw-r--r--internal/system.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/system.go b/internal/system.go
index 6467ea05..5f5e76bc 100644
--- a/internal/system.go
+++ b/internal/system.go
@@ -55,7 +55,7 @@ func CopyPaths(os System, v *Paths) {
fmsg.VPrintf("process share directory at %q", v.SharePath)
- if r, ok := os.LookupEnv(xdgRuntimeDir); !ok {
+ if r, ok := os.LookupEnv(xdgRuntimeDir); !ok || r == "" || !path.IsAbs(r) {
// fall back to path in share since fortify has no hard XDG dependency
v.RunDirPath = path.Join(v.SharePath, "run")
v.RuntimePath = path.Join(v.RunDirPath, "compat")