|
|
|
@ -72,13 +72,11 @@ main(){ |
|
|
|
|
int http_code = HTTP_ERROR; |
|
|
|
|
if (access(DIR, W_OK) != 0) { |
|
|
|
|
fprintf(stderr, "Directory %s does not exist or is not writable\n", DIR); |
|
|
|
|
http_code = HTTP_ERROR; |
|
|
|
|
goto out; |
|
|
|
|
} |
|
|
|
|
// first chdir() and then chroot()!
|
|
|
|
|
if (!( chdir(DIR) == 0 && chroot(DIR) == 0 )) { |
|
|
|
|
fprintf(stderr, "Cannot chdir and chroot into %s\n", DIR); |
|
|
|
|
http_code = HTTP_ERROR; |
|
|
|
|
goto out; |
|
|
|
|
} |
|
|
|
|
while(FCGI_Accept() >= 0) { |
|
|
|
|