about 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)
downloadtest-275d657b8b3bccd7d7d6055cbe09de4e85be7659.tar.gz
test-275d657b8b3bccd7d7d6055cbe09de4e85be7659.zip
Move unveilAll back into main
It doesn't do as much anymore, so move it back inline.
-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)];
commitgraph'>* | | | | Merge branch 'sn/subject-link'Lars Hjemli2010-06-19 |\ \ \ \ \ | * | | | | Optionally generate verbose parent linksLars Hjemli2010-02-27 | * | | | | display subject instead of sha1 as link title of parentsStefan Naewe2010-02-27 * | | | | | Merge branch 'stable'Lars Hjemli2010-04-08 |\ \ \ \ \ \ | |_|_|_|/ / |/| | | | / | | |_|_|/ | |/| | | | * | | | shared.c: avoid memory leak during diffLars Hjemli2010-04-08 * | | | | ui-tree: add link to plain view for blobs in tree listingLars Hjemli2010-02-28 | |_|_|/ |/| | | * | | | Use GIT-1.7.0Lars Hjemli2010-02-27 * | | | Merge branch 'html-updates' of git://github.com/MarkLodato/cgitLars Hjemli2010-02-27 |\ \ \ \ | |_|/ / |/| | | | * | | html: properly percent-escape URLsMark Lodato2010-02-09 | * | | html: make all strings 'const char *'Mark Lodato2010-02-08 | | |/ | |/| * | | Merge branch 'stable'Lars Hjemli2010-02-27 |\ \ \ | |/ / |/| / | |/ | * Clear the whole contextDaniel Milde2010-02-27 | * ui-shared.c: fix segfault when repo is emptyFlorian Pritz2010-02-27 * | Merge branch 'stable'Lars Hjemli2009-12-12 |\| | * CGIT 0.8.3.1Lars Hjemli2009-12-12 | * Fix segfault on ppc when browsing treeMartins Polakovs2009-12-12 * | Add .tar.xz-snapshot supportAndreas Wiese2009-12-08 * | Merge branch 'lh/remote-branches'Lars Hjemli2009-12-08 |\ \ | * | Add support for remote branchesLars Hjemli2009-11-07 * | | Merge branch 'ro/ssdiff'Lars Hjemli2009-12-08 |\ \ \ | * | | In side-by-side diff, add support for marking individual characters.Ragnar Ouchterlony2009-11-07 | * | | Fixed side-by-side diff bugs related to binary diff and more.Ragnar Ouchterlony2009-09-16 | * | | Polishing of how the side-by-side diff looks.Ragnar Ouchterlony2009-09-16 | * | | Add possibility to switch between unidiff and side-by-side-diff.Ragnar Ouchterlony2009-09-16 | * | | First version of side-by-side diff.Ragnar Ouchterlony2009-09-16 * | | | Merge branch 'master' of http://op-co.de/cgitLars Hjemli2009-12-08 |\ \ \ \ | * | | | "max-blob-size" config var to limit generated HTML sizeGeorg Lukas2009-11-28 | * | | | cgit.css: highlight directories in treeGeorg Lukas2009-11-28 | * | | | syntax highlighting for all formats supported by "highlight"Georg Lukas2009-11-19 | | |/ / | |/| | * | | | Merge branch 'stable'Lars Hjemli2009-12-08 |\ \ \ \ | |/ / / |/| | / | | |/ | |/| | * | Don't crash when a repo-specific readme file is usedSami Kyöstilä2009-12-08 * | | Merge branch 'stable'Lars Hjemli2009-11-07 |\| | | * | shared.c: return original errnoLars Hjemli2009-11-07 * | | Add NO_OPENSSL optionMikhail Gusarov2009-11-07 * | | Merge branch 'stable'Lars Hjemli2009-11-07 |\| | | * | Close fd on error in readfile()Rys Sommefeldt2009-11-07 | * | Nov is the correct abbreviationDanijel Tašov2009-11-07 * | | ui-shared.c: prettify download links when generated from tag pageLars Hjemli2009-10-16