[hackers] [quark] small style and CGI message fix || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Thu, 14 Aug 2014 17:49:48 +0200

commit 159cdb3e0b6c239a319f951291ed9e3886d38cc6
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Thu Aug 14 17:07:33 2014 +0000

    small style and CGI message fix

diff --git a/quark.c b/quark.c
index 27ec6a6..dc28d82 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -57,9 +57,9 @@ enum {
 
 static const char *resentry[] = {
         [HEADER] = "HTTP/1.1 %s
"
- "Connection: close
"
- "Date: %s
"
- "Server: quark-"VERSION"
",
+ "Connection: close
"
+ "Date: %s
"
+ "Server: quark-"VERSION"
",
         [CONTENTLEN] = "Content-Length: %lu
",
         [LOCATION] = "Location: %s%s
",
         [CONTENTTYPE] = "Content-Type: %s
",
_AT_@ -335,8 +335,8 @@ responsecgi(void) {
                 }
                 pclose(cgi);
         } else {
- logerrmsg("error %s requests %s, but cannot run cgi script %s
",
- host, cgi_script, reqbuf);
+ logerrmsg("error %s requests %s, but cannot run cgi script %s: %s
",
+ host, reqbuf, cgi_script, strerror(errno));
                 if (putresentry(HEADER, HttpNotFound, tstamp(0))
                  || putresentry(CONTENTTYPE, texthtml))
                         return;
_AT_@ -351,7 +351,7 @@ response(void) {
         char *p;
         struct stat st;
 
- for (p = reqbuf; *p; p++)
+ for (p = reqbuf; *p; p++) {
                 if (*p == '\' || (*p == '/' && *(p + 1) == '.')) {
                         /* don't serve bogus or hidden files */
                         if (putresentry(HEADER, HttpForbidden, tstamp(0))
_AT_@ -362,6 +362,8 @@ response(void) {
                                 writetext("
<html><body>"HttpForbidden"</body></html>
");
                         return;
                 }
+ }
+
         if (cgi_mode) {
                 responsecgi();
         } else {
Received on Thu Aug 14 2014 - 17:49:48 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 14 2014 - 18:00:11 CEST