--- Makefile | 2 +- config.def.h | 2 ++ main.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index da0e458..61da150 100644 --- a/Makefile +++ b/Makefile _AT_@ -10,7 +10,7 @@ all: quark data.o: data.c data.h http.h util.h config.mk http.o: http.c config.h http.h util.h config.mk -main.o: main.c arg.h data.h http.h queue.h sock.h util.h config.mk +main.o: config.h main.c arg.h data.h http.h queue.h sock.h util.h config.mk sock.o: sock.c sock.h util.h config.mk util.o: util.c util.h config.mk diff --git a/config.def.h b/config.def.h index 56f62aa..7cccad2 100644 --- a/config.def.h +++ b/config.def.h _AT_@ -4,6 +4,8 @@ #define BUFFER_SIZE 4096 #define FIELD_MAX 200 +#define ENABLE_NPROC_LIMIT 1 + /* mime-types */ static const struct { char *ext; diff --git a/main.c b/main.c index 86b2d0c..f09b5db 100644 --- a/main.c +++ b/main.c _AT_@ -19,6 +19,7 @@ #include "arg.h" #include "data.h" +#include "config.h" #include "http.h" #include "queue.h" #include "sock.h" _AT_@ -646,6 +647,7 @@ main(int argc, char *argv[]) } /* set the thread limit (2 + nthreads) */ +#if ENABLE_NPROC_LIMIT rlim.rlim_cur = rlim.rlim_max = 2 + nthreads; if (setrlimit(RLIMIT_NPROC, &rlim) < 0) { if (errno == EPERM) { _AT_@ -655,6 +657,7 @@ main(int argc, char *argv[]) die("setrlimit:"); } } +#endif /* limit ourselves to reading the servedir and block further unveils */ eunveil(servedir, "r"); -- 2.30.0Received on Sun Jan 17 2021 - 17:29:53 CET
This archive was generated by hypermail 2.3.0 : Sun Jan 17 2021 - 17:36:36 CET