summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-10 15:40:45 -0400
committerJune McEnroe <june@causal.agency>2021-06-10 15:40:45 -0400
commit275d657b8b3bccd7d7d6055cbe09de4e85be7659 (patch)
tree7fcf0f60c9b81933c49cf0d848518521c28f663f
parentOnly explicitly load the default CA file on OpenBSD (diff)
downloadcatgirl-275d657b8b3bccd7d7d6055cbe09de4e85be7659.tar.gz
catgirl-275d657b8b3bccd7d7d6055cbe09de4e85be7659.zip
Move unveilAll back into main
It doesn't do as much anymore, so move it back inline.
Diffstat (limited to '')
-rw-r--r--chat.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/chat.c b/chat.c
index 9a276d5..4f3c233 100644
--- a/chat.c
+++ b/chat.c
@@ -127,7 +127,6 @@ static void parseHash(char *str) {
 }
 
 #ifdef __OpenBSD__
-
 static void unveilData(const char *name) {
 	const char *dirs = NULL;
 	for (const char *path; NULL != (path = dataPath(&dirs, name));) {
@@ -135,16 +134,7 @@ static void unveilData(const char *name) {
 		if (error && errno != ENOENT) err(EX_CANTCREAT, "%s", path);
 	}
 }
-
-static void unveilAll(void) {
-	if (save || logEnable) {
-		dataMkdir("");
-		unveilData("");
-	}
-	if (save) unveilData(save);
-}
-
-#endif /* __OpenBSD__ */
+#endif
 
 static volatile sig_atomic_t signals[NSIG];
 static void signalHandler(int signal) {
@@ -288,7 +278,13 @@ int main(int argc, char *argv[]) {
 	uiInitEarly();
 
 #ifdef __OpenBSD__
-	if (self.restricted) unveilAll();
+	if (self.restricted) {
+		if (save || logEnable) {
+			dataMkdir("");
+			unveilData("");
+		}
+		if (save) unveilData(save);
+	}
 
 	char promises[64] = "stdio tty";
 	char *ptr = &promises[strlen(promises)], *end = &promises[sizeof(promises)];
span>Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe Mixed bag like most collections of short stories. Some of them are pretty good. The author of the worst written story also has the worst written bio. 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe