Documentation Source Text

Check-in [8cda91e897]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a typo in althttpd.c - restore the behavior of index.cgi.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8cda91e89746107aeaa8b9dfef6b551e2ac1ca36197d8b7881ce30c5eae425a4
User & Date: drh 2019-04-27 11:27:39
Context
2019-04-27
18:42
Updates to the althttpd.md documentation. check-in: 7dcc5545d1 user: drh tags: trunk
11:27
Fix a typo in althttpd.c - restore the behavior of index.cgi. check-in: 8cda91e897 user: drh tags: trunk
2019-04-24
19:28
The attack that the previous check-in sought to mitigate has stopped. So comment-out the change of the previous check-in. check-in: 4e3b689944 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to misc/althttpd.c.

  1924   1924         if( access(zLine,R_OK) ){
  1925   1925           NotFound(390);  /* LOG: File not readable */
  1926   1926         }
  1927   1927         zRealScript = StrDup(&zLine[j0]);
  1928   1928         break;
  1929   1929       }
  1930   1930       if( zScript[i]==0 || zScript[i+1]==0 ){
  1931         -      static const char *azIndex[] = { "/home", "/index.html", "index.cgi" };
         1931  +      static const char *azIndex[] = { "/home", "/index.html", "/index.cgi" };
  1932   1932         int k = j>0 && zLine[j-1]=='/' ? j-1 : j;
  1933   1933         unsigned int jj;
  1934   1934         for(jj=0; jj<sizeof(azIndex)/sizeof(azIndex[0]); jj++){
  1935   1935           strcpy(&zLine[k],azIndex[jj]);
  1936   1936           if( stat(zLine,&statbuf)!=0 ) continue;
  1937   1937           if( !S_ISREG(statbuf.st_mode) ) continue;
  1938   1938           if( access(zLine,R_OK) ) continue;