about summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2021-06-19 14:57:00 +0000
committerJune McEnroe <june@causal.agency>2021-06-20 20:21:00 -0400
commit3a38e36717ff24a3c028c1c7cfe477d9fec95498 (patch)
treea22ab9715396e65e95c332de4e2c58814ad9ab4e /chat.c
parentHandle "\1ACTION\1" empty actions (diff)
downloadcatgirl-3a38e36717ff24a3c028c1c7cfe477d9fec95498.tar.gz
catgirl-3a38e36717ff24a3c028c1c7cfe477d9fec95498.zip
OpenBSD: Only unveil used directories
dataMkdir() already picked the appropiate directory so make it
return that such that unveilData() can go as only that one directory
needs unveiling.
Diffstat (limited to '')
-rw-r--r--chat.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/chat.c b/chat.c
index 8816068..479ec94 100644
--- a/chat.c
+++ b/chat.c
@@ -127,16 +127,6 @@ static void parseHash(char *str) {
 	if (*str) hashBound = strtoul(&str[1], NULL, 0);
 }
 
-#ifdef __OpenBSD__
-static void unveilData(const char *name) {
-	const char *dirs = NULL;
-	for (const char *path; NULL != (path = dataPath(&dirs, name));) {
-		int error = unveil(path, "wc");
-		if (error && errno != ENOENT) err(EX_CANTCREAT, "%s", path);
-	}
-}
-#endif
-
 static volatile sig_atomic_t signals[NSIG];
 static void signalHandler(int signal) {
 	signals[signal] = 1;
@@ -287,8 +277,9 @@ int main(int argc, char *argv[]) {
 
 #ifdef __OpenBSD__
 	if (self.restricted && logEnable) {
-		dataMkdir("");
-		unveilData("");
+		const char *logdir = dataMkdir("");
+		int error = unveil(logdir, "wc");
+		if (error) err(EX_OSERR, "unveil");
 	}
 
 	char promises[64] = "stdio tty";
causal.agency/2024-07-01/lens?id=d8f7fc0bada2c1740e814ba67449df6e928812ff&follow=1'>Add photos from July 1June McEnroe 2024-07-07Add photos from June 25-30June McEnroe 2024-06-30Add photos from June 22 (and the few days after that)June McEnroe 2024-06-30Accommodate lower-case .jpg filesJune McEnroe 2024-06-23Add another BACKXWASH showJune McEnroe It was good! 2024-06-16Update bioJune McEnroe 2024-06-15Add photo descriptions from June 12June McEnroe 2024-06-10Add first roll of film from June 8June McEnroe 2024-06-10Cope with not having an EXIF infoJune McEnroe 2024-06-10Resize using target pixel counts for consistencyJune McEnroe This will resize film scans to about the same size as for the digital photos. 2024-06-10Add The Girl Who Was Convinced...June McEnroe Not much there. The illustrations are very nice though. 2024-06-09Add photos from May 31June McEnroe 2024-06-09Use monospace on photo pagesJune McEnroe 2024-06-09Put lens and (future) film at the tops of photo pagesJune McEnroe 2024-05-22Remove use of sysexits.hJune McEnroe 2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe 2024-05-21Fix = precedence in whenJune McEnroe