[Nginx] fixing startup crashes (#4425)

* fixing startup crashes

* Removed whitespaces
This commit is contained in:
Yunshu Ouyang 2020-09-08 21:07:01 +02:00 committed by GitHub
parent 26cb1c648c
commit dc44763e9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -24,7 +24,7 @@ rm -rf genfiles && mkdir genfiles && $SRC/LPM/external.protobuf/bin/protoc http_
cd ../..
auto/configure \
--with-ld-opt="-Wl,--wrap=listen -Wl,--wrap=setsockopt -Wl,--wrap=bind -Wl,--wrap=shutdown -Wl,--wrap=connect -Wl,--wrap=getpwnam -Wl,--wrap=getgrnam" \
--with-ld-opt="-Wl,--wrap=listen -Wl,--wrap=setsockopt -Wl,--wrap=bind -Wl,--wrap=shutdown -Wl,--wrap=connect -Wl,--wrap=getpwnam -Wl,--wrap=getgrnam -Wl,--wrap=chmod -Wl,--wrap=chown" \
--with-http_v2_module
make -f objs/Makefile fuzzers

View File

@ -30,7 +30,6 @@ extern "C" {
#include "libprotobuf-mutator/src/libfuzzer/libfuzzer_macro.h"
static char configuration[] =
"user root;\n"
"error_log stderr emerg;\n"
"events {\n"
" use epoll;\n"

View File

@ -15,6 +15,7 @@
////////////////////////////////////////////////////////////////////////////////
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grp.h>
#include <pwd.h>
@ -35,6 +36,14 @@ int __wrap_setsockopt(int fd, int level, int optname, const void *optval,
return 0;
}
int __wrap_chmod(const char *pathname, mode_t mode){
return 0;
}
int __wrap_chown(const char *pathname, uid_t owner, gid_t group){
return 0;
}
struct passwd *__wrap_getpwnam(const char *name){
struct passwd *pwd = (struct passwd *) calloc(1, sizeof(struct passwd));
pwd->pw_uid = 1;