make libgcgi compile on Linux add macros for unveil and pledge for systems that… | |
git clone git://bitreich.org/libgcgi git://hg6vgqziawt5s4dj.onion/libgcgi | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit cd632cd80d1400eced74e91a2dad416dbe0c01c2 | |
parent 2448c0d37ce7001aae8b49484d9fe08ff5573665 | |
Author: Christoph Lohmann <[email protected]> | |
Date: Sat, 30 Jul 2022 13:08:13 +0200 | |
make libgcgi compile on Linux | |
add macros for unveil and pledge for systems that don not have it. | |
Diffstat: | |
M index.c | 7 +++++++ | |
1 file changed, 7 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/index.c b/index.c | |
@@ -8,8 +8,14 @@ | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
+ | |
#include "libgcgi.h" | |
+#ifndef __OpenBSD__ | |
+#define pledge(p1,p2) 0 | |
+#define unveil(p1,p2) 0 | |
+#endif | |
+ | |
static void | |
error_404(char **matches) | |
{ | |
@@ -33,6 +39,7 @@ static struct gcgi_handler handlers[] = { | |
int | |
main(int argc, char **argv) | |
{ | |
+ | |
/* restrict allowed paths */ | |
unveil("gph", "r"); | |
unveil("db", "rwc"); |