Fossil SCM
Add a new robot detection string.
Commit
1e2d76ecb204347c580f1571e384f4bed5be5845
Parent
24cfcee7ccd17a8…
1 file changed
+7
+7
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -393,10 +393,17 @@ | ||
| 393 | 393 | /* If a URI appears in the User-Agent, it is probably a bot */ |
| 394 | 394 | if( strncmp("http", zAgent+i,4)==0 ) return 0; |
| 395 | 395 | } |
| 396 | 396 | if( strncmp(zAgent, "Mozilla/", 8)==0 ){ |
| 397 | 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 | + | |
| 398 | 405 | if( sqlite3_strglob("*Firefox/[1-9]*", zAgent)==0 ) return 1; |
| 399 | 406 | if( sqlite3_strglob("*Chrome/[1-9]*", zAgent)==0 ) return 1; |
| 400 | 407 | if( sqlite3_strglob("*(compatible;?MSIE?[1789]*", zAgent)==0 ) return 1; |
| 401 | 408 | if( sqlite3_strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent)==0 ) return 1; /* IE11+ */ |
| 402 | 409 | if( sqlite3_strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent)==0 ) return 1; |
| 403 | 410 |
| --- 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 |