summary refs log tree commit diff stats
path: root/cache
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-04-04 21:59:01 +0530
committerAndinus <andinus@nand.sh>2020-04-04 21:59:01 +0530
commit206a776f64c9163ab597c25a61040c08c012dfd0 (patch)
tree62c45c0ba66453d1103a566febfbe5df6d893839 /cache
parentffe417d98b545333f17fc1aec055e6fe44b1dc56 (diff)
downloadcetus-206a776f64c9163ab597c25a61040c08c012dfd0.tar.gz
Fix unveil rules
Diffstat (limited to 'cache')
-rw-r--r--cache/getdir_unix.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/cache/getdir_unix.go b/cache/getdir_unix.go
index 62dd5ed..a65d389 100644
--- a/cache/getdir_unix.go
+++ b/cache/getdir_unix.go
@@ -12,6 +12,18 @@ import (
 // that is not set then assume it to be the default value which is
 // $HOME/.cache according to XDG Base Directory Specification.
 func GetDir() string {
+	cacheDir := Dir()
+
+	// Cetus cache directory is cacheDir/cetus.
+	cetusCacheDir := fmt.Sprintf("%s/%s", cacheDir,
+		"cetus")
+
+	return cetusCacheDir
+}
+
+// Dir returns the system cache directory, this is useful for unveil
+// in OpenBSD.
+func Dir() string {
 	cacheDir := os.Getenv("CETUS_CACHE_DIR")
 	if len(cacheDir) == 0 {
 		cacheDir = os.Getenv("XDG_CACHE_HOME")
@@ -21,9 +33,5 @@ func GetDir() string {
 			".cache")
 	}
 
-	// Cetus cache directory is cacheDir/cetus.
-	cetusCacheDir := fmt.Sprintf("%s/%s", cacheDir,
-		"cetus")
-
-	return cetusCacheDir
+	return cacheDir
 }
tion' href='/akspecs/aerc/commit/config/aerc.conf?h=0.3.0&id=39c93d2897af5bb0c145ef4f99f542bf42babdab'>39c93d2 ^
bbdf9df ^


39c93d2 ^
bbdf9df ^

39c93d2 ^








b83e7c9 ^






065da5e ^






bbdf9df ^








8e5ed2a ^

61206c6 ^

37f0114 ^
e0cadd6 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80