Fossil SCM

Add a new robot detection string.

drh 2016-05-30 21:10 trunk
Commit 1e2d76ecb204347c580f1571e384f4bed5be5845
1 file changed +7
--- src/login.c
+++ src/login.c
@@ -393,10 +393,17 @@
393393
/* If a URI appears in the User-Agent, it is probably a bot */
394394
if( strncmp("http", zAgent+i,4)==0 ) return 0;
395395
}
396396
if( strncmp(zAgent, "Mozilla/", 8)==0 ){
397397
if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */
398
+
399
+ /* 2016-05-30: A pernicious spider that likes to walk Fossil timelines has
400
+ ** been detected on the SQLite website. The spider changes its user-agent
401
+ ** string frequently, but it always seems to include the following text:
402
+ */
403
+ if( sqlite3_strglob("*Safari/537.36Mozilla/5.0*", zAgent)==0 ) return 0;
404
+
398405
if( sqlite3_strglob("*Firefox/[1-9]*", zAgent)==0 ) return 1;
399406
if( sqlite3_strglob("*Chrome/[1-9]*", zAgent)==0 ) return 1;
400407
if( sqlite3_strglob("*(compatible;?MSIE?[1789]*", zAgent)==0 ) return 1;
401408
if( sqlite3_strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent)==0 ) return 1; /* IE11+ */
402409
if( sqlite3_strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent)==0 ) return 1;
403410
--- src/login.c
+++ src/login.c
@@ -393,10 +393,17 @@
393 /* If a URI appears in the User-Agent, it is probably a bot */
394 if( strncmp("http", zAgent+i,4)==0 ) return 0;
395 }
396 if( strncmp(zAgent, "Mozilla/", 8)==0 ){
397 if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */
 
 
 
 
 
 
 
398 if( sqlite3_strglob("*Firefox/[1-9]*", zAgent)==0 ) return 1;
399 if( sqlite3_strglob("*Chrome/[1-9]*", zAgent)==0 ) return 1;
400 if( sqlite3_strglob("*(compatible;?MSIE?[1789]*", zAgent)==0 ) return 1;
401 if( sqlite3_strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent)==0 ) return 1; /* IE11+ */
402 if( sqlite3_strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent)==0 ) return 1;
403
--- src/login.c
+++ src/login.c
@@ -393,10 +393,17 @@
393 /* If a URI appears in the User-Agent, it is probably a bot */
394 if( strncmp("http", zAgent+i,4)==0 ) return 0;
395 }
396 if( strncmp(zAgent, "Mozilla/", 8)==0 ){
397 if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */
398
399 /* 2016-05-30: A pernicious spider that likes to walk Fossil timelines has
400 ** been detected on the SQLite website. The spider changes its user-agent
401 ** string frequently, but it always seems to include the following text:
402 */
403 if( sqlite3_strglob("*Safari/537.36Mozilla/5.0*", zAgent)==0 ) return 0;
404
405 if( sqlite3_strglob("*Firefox/[1-9]*", zAgent)==0 ) return 1;
406 if( sqlite3_strglob("*Chrome/[1-9]*", zAgent)==0 ) return 1;
407 if( sqlite3_strglob("*(compatible;?MSIE?[1789]*", zAgent)==0 ) return 1;
408 if( sqlite3_strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent)==0 ) return 1; /* IE11+ */
409 if( sqlite3_strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent)==0 ) return 1;
410

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button