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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9005943d914a49a86d468e7646abd5ca3a78fcf54bfb7024fb1c18d2f3990595
User & Date: drh 2018-06-07 18:29:22.445
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
Unified Diff Show Whitespace Changes Patch
Changes to misc/althttpd.c.
775
776
777
778
779
780
781


782
783
784
785
786
787
788
**    *  Blank lines and lines that begin with '#' are ignored
**    *  "http-redirect" forces a redirect to HTTPS if not there already
**    *  "https-only" disallows operation in HTTP
**    *  "user NAME LOGIN:PASSWORD" checks to see if LOGIN:PASSWORD 
**       authorization credentials are provided, and if so sets the
**       REMOTE_USER to NAME.
**    *  "realm TEXT" sets the realm to TEXT.


*/
static int CheckBasicAuthorization(const char *zAuthFile){
  FILE *in;
  char *zRealm = "unknown realm";
  char *zLoginPswd;
  char *zName;
  char zLine[2000];







>
>







775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
**    *  Blank lines and lines that begin with '#' are ignored
**    *  "http-redirect" forces a redirect to HTTPS if not there already
**    *  "https-only" disallows operation in HTTP
**    *  "user NAME LOGIN:PASSWORD" checks to see if LOGIN:PASSWORD 
**       authorization credentials are provided, and if so sets the
**       REMOTE_USER to NAME.
**    *  "realm TEXT" sets the realm to TEXT.
**    *  "anyone" bypasses authentication and allows anyone to see the
**       files.  Useful in combination with "http-redirect"
*/
static int CheckBasicAuthorization(const char *zAuthFile){
  FILE *in;
  char *zRealm = "unknown realm";
  char *zLoginPswd;
  char *zName;
  char zLine[2000];
823
824
825
826
827
828
829



830
831
832
833
834
835
836
      if( !useHttps ){
        zHttp = "https";
        sprintf(zLine, "%s%s", zScript, zPathInfo);
        Redirect(zLine, 1, 170); /* LOG: -auth redirect */
        fclose(in);
        return 0;
      }



    }else{
      NotFound(180);  /* LOG:  malformed entry in -auth file */
      fclose(in);
      return 0;
    }
  }
  fclose(in);







>
>
>







825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
      if( !useHttps ){
        zHttp = "https";
        sprintf(zLine, "%s%s", zScript, zPathInfo);
        Redirect(zLine, 1, 170); /* LOG: -auth redirect */
        fclose(in);
        return 0;
      }
    }else if( strcmp(zFieldName,"anyone")==0 ){
      fclose(in);
      return 1;
    }else{
      NotFound(180);  /* LOG:  malformed entry in -auth file */
      fclose(in);
      return 0;
    }
  }
  fclose(in);