Documentation Source Text

Check-in [9005943d91]
Login

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

Overview
Comment:In althttpd.c, add the "anyone" line to the -auth file syntax. This allows inserting an -auth file that reads "http-redirect \n anyone" and which will force HTTP connections to redirect to HTTPS.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9005943d914a49a86d468e7646abd5ca3a78fcf54bfb7024fb1c18d2f3990595
User & Date: drh 2018-06-07 18:29:22
Context
2018-06-08
13:41
Fix the -auth redirect logic to avoid duplicating part of the URL. check-in: 76396bf1df user: drh tags: trunk
2018-06-07
18:29
In althttpd.c, add the "anyone" line to the -auth file syntax. This allows inserting an -auth file that reads "http-redirect \n anyone" and which will force HTTP connections to redirect to HTTPS. check-in: 9005943d91 user: drh tags: trunk
2018-06-05
13:43
Add hyperlinks for "index b-tree" and "table b-tree". check-in: 35ca8da032 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to misc/althttpd.c.

   775    775   **    *  Blank lines and lines that begin with '#' are ignored
   776    776   **    *  "http-redirect" forces a redirect to HTTPS if not there already
   777    777   **    *  "https-only" disallows operation in HTTP
   778    778   **    *  "user NAME LOGIN:PASSWORD" checks to see if LOGIN:PASSWORD 
   779    779   **       authorization credentials are provided, and if so sets the
   780    780   **       REMOTE_USER to NAME.
   781    781   **    *  "realm TEXT" sets the realm to TEXT.
          782  +**    *  "anyone" bypasses authentication and allows anyone to see the
          783  +**       files.  Useful in combination with "http-redirect"
   782    784   */
   783    785   static int CheckBasicAuthorization(const char *zAuthFile){
   784    786     FILE *in;
   785    787     char *zRealm = "unknown realm";
   786    788     char *zLoginPswd;
   787    789     char *zName;
   788    790     char zLine[2000];
................................................................................
   823    825         if( !useHttps ){
   824    826           zHttp = "https";
   825    827           sprintf(zLine, "%s%s", zScript, zPathInfo);
   826    828           Redirect(zLine, 1, 170); /* LOG: -auth redirect */
   827    829           fclose(in);
   828    830           return 0;
   829    831         }
          832  +    }else if( strcmp(zFieldName,"anyone")==0 ){
          833  +      fclose(in);
          834  +      return 1;
   830    835       }else{
   831    836         NotFound(180);  /* LOG:  malformed entry in -auth file */
   832    837         fclose(in);
   833    838         return 0;
   834    839       }
   835    840     }
   836    841     fclose(in);