Fossil

Check-in [661991aa62]
Login

Check-in [661991aa62]

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

Overview
Comment:Add /zip and /tarball pages to the robot-squelch mechanism.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 661991aa62ad2dda327ec03ad9c5622af6bded754eb8b30ebe6605acff833b6b
User & Date: drh 2025-08-15 19:58:23.861
Context
2025-08-16
10:10
Correct the signature of an extern decl of fossil_strndup(), as reported in [forum:21ac5f59a0 | forum post 21ac5f59a0]. ... (check-in: d546932976 user: stephan tags: trunk)
2025-08-15
23:18
Simplifications to the logic that tries to keep robots out. ... (check-in: 02adced1c1 user: drh tags: robot-restrict-simplified)
19:58
Add /zip and /tarball pages to the robot-squelch mechanism. ... (check-in: 661991aa62 user: drh tags: trunk)
19:07
Add the "robot-squelch" defense against bot-nets. Still incomplete, but sufficient to hold off the latest attacks. ... (check-in: de66eeaab7 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/tar.c.
758
759
760
761
762
763
764

765
766
767
768
769
770
771
  Glob *pInclude = 0;           /* The compiled in= glob pattern */
  Glob *pExclude = 0;           /* The compiled ex= glob pattern */
  Blob tarball;                 /* Tarball accumulated here */
  const char *z;

  login_check_credentials();
  if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }

  fossil_nice_default();
  zName = fossil_strdup(PD("name",""));
  z = P("r");
  if( z==0 ) z = P("uuid");
  if( z==0 ) z = tar_uuid_from_name(&zName);
  if( z==0 ) z = "trunk";
  g.zOpenRevision = zRid = fossil_strdup(z);







>







758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
  Glob *pInclude = 0;           /* The compiled in= glob pattern */
  Glob *pExclude = 0;           /* The compiled ex= glob pattern */
  Blob tarball;                 /* Tarball accumulated here */
  const char *z;

  login_check_credentials();
  if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
  if( robot_squelch(900) ) return;
  fossil_nice_default();
  zName = fossil_strdup(PD("name",""));
  z = P("r");
  if( z==0 ) z = P("uuid");
  if( z==0 ) z = tar_uuid_from_name(&zName);
  if( z==0 ) z = "trunk";
  g.zOpenRevision = zRid = fossil_strdup(z);
Changes to src/zip.c.
1010
1011
1012
1013
1014
1015
1016

1017
1018
1019
1020
1021
1022
1023
  Glob *pExclude = 0;           /* The compiled ex= glob pattern */
  Blob zip;                     /* ZIP archive accumulated here */
  int eType = ARCHIVE_ZIP;      /* Type of archive to generate */
  char *zType;                  /* Human-readable archive type */

  login_check_credentials();
  if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }

  if( fossil_strcmp(g.zPath, "sqlar")==0 ){
    eType = ARCHIVE_SQLAR;
    zType = "SQL";
    /* For some reason, SQL-archives are like catnip for robots.  So
    ** don't allow them to be downloaded by user "nobody" */
    if( g.zLogin==0 ){ login_needed(g.anon.Zip); return; }
  }else{







>







1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
  Glob *pExclude = 0;           /* The compiled ex= glob pattern */
  Blob zip;                     /* ZIP archive accumulated here */
  int eType = ARCHIVE_ZIP;      /* Type of archive to generate */
  char *zType;                  /* Human-readable archive type */

  login_check_credentials();
  if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
  if( robot_squelch(900) ) return;
  if( fossil_strcmp(g.zPath, "sqlar")==0 ){
    eType = ARCHIVE_SQLAR;
    zType = "SQL";
    /* For some reason, SQL-archives are like catnip for robots.  So
    ** don't allow them to be downloaded by user "nobody" */
    if( g.zLogin==0 ){ login_needed(g.anon.Zip); return; }
  }else{