tonly pledge(1)/unveil(1) on OpenBSD - vote - simple cgi voting system for web and gopher
HTML git clone git://src.adamsgaard.dk/vote
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit f49595b9c30a3a21c5380807654b1b43379e5b0d
DIR parent f01eecbd79247d95d642b91d732dd5338c944417
HTML Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 27 Sep 2020 07:46:29 +0200
only pledge(1)/unveil(1) on OpenBSD
Diffstat:
M vote.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
DIR diff --git a/vote.c b/vote.c
t@@ -77,6 +77,7 @@ int
main() {
struct stat sb;
+#ifdef __OpenBSD__
if (unveil(getenv("PWD"), NULL) == -1 || unveil(NULL, NULL) == -1) {
fprintf(stderr, "unveil: %s\n", strerror(errno));
die_500();
t@@ -86,6 +87,7 @@ main() {
fprintf(stderr, "pledge: %s\n", strerror(errno));
die_500();
}
+#endif
if (stat(POLLS_DIR, &sb) == -1) {
if (mkdir(POLLS_DIR, 0755) == -1) {