turn index.c into something suitable for an exapmle - libgcgi - REST library fo… | |
git clone git://bitreich.org/libgcgi git://hg6vgqziawt5s4dj.onion/libgcgi | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit 5bc5afc6bfca4948fee87a59a87aede28f2de765 | |
parent 875d6f5a34f5592631c24949f612194ba7d626e6 | |
Author: Josuah Demangeon <[email protected]> | |
Date: Sat, 30 Jul 2022 13:24:21 +0200 | |
turn index.c into something suitable for an exapmle | |
Diffstat: | |
M index.c | 7 ++++--- | |
1 file changed, 4 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/index.c b/index.c | |
@@ -41,11 +41,12 @@ main(int argc, char **argv) | |
{ | |
/* restrict allowed paths */ | |
- unveil("gph", "r"); | |
- unveil("db", "rwc"); | |
+ if (unveil("gph", "r") == -1 || unveil("db", "rwc") == -1) | |
+ gcgi_fatal("unveil failed"); | |
/* restrict allowed system calls */ | |
- pledge("stdio rpath wpath cpath", NULL); | |
+ if (pledge("stdio rpath wpath cpath", NULL) == -1) | |
+ gcgi_fatal("pledge failed"); | |
/* handle the request with the handlers */ | |
gcgi_handle_request(handlers, argv, argc); |