| | @@ -164,11 +164,11 @@ |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /* Condition 4: If there is a "token=VALUE" query parameter with a |
| 167 | 167 | ** valid VALUE argument, then assume that the request is coming from |
| 168 | 168 | ** either an interactive human session, or an authorized robot that we |
| 169 | | - ** want to treat as human. All it through and also set the robot cookie. |
| 169 | + ** want to treat as human. Allow it through and also set the robot cookie. |
| 170 | 170 | */ |
| 171 | 171 | z = P("token"); |
| 172 | 172 | if( z!=0 ){ |
| 173 | 173 | if( db_exists("SELECT 1 FROM config" |
| 174 | 174 | " WHERE name='token-%q'" |
| | @@ -265,17 +265,20 @@ |
| 265 | 265 | ** should be disallowed. "Unauthenticated" means the user is "nobody". |
| 266 | 266 | ** The recommended value for this setting is: |
| 267 | 267 | ** |
| 268 | 268 | ** timelineX,diff,annotate,fileage,file,finfo,reports,tree,download,hexdump |
| 269 | 269 | ** |
| 270 | | -** The "diff" tag covers all diffing pages such as /vdiff, /fdiff, and |
| 271 | | -** /vpatch. The "annotate" tag also covers /blame and /praise. "zip" |
| 272 | | -** also covers /tarball and /sqlar. If a tag has an "X" character appended |
| 273 | | -** then it only applies if query parameters are such that the page is |
| 274 | | -** particularly difficult to compute. In all other case, the tag should |
| 275 | | -** exactly match the page name. Useful "X" tags include "timelineX" and |
| 276 | | -** "zipX". See the [[robot-zip-leaf]] and [[robot-zip-tag]] settings |
| 270 | +** Usually the tag should exactly match the page name. The "diff" tag |
| 271 | +** covers all diffing pages such as /vdiff, /fdiff, and /vpatch. The |
| 272 | +** "annotate" tag also covers /blame and /praise. "zip" also covers |
| 273 | +** /tarball and /sqlar. If a tag has an "X" character appended then it |
| 274 | +** only applies if query parameters are such that the page is particularly |
| 275 | +** difficult to compute. Useful "X" tags include "timelineX" and "zipX". |
| 276 | +** The "ext" tag matches all extension, but a tag of the form "ext/PATH" |
| 277 | +** only matches the extension at PATH. |
| 278 | +** |
| 279 | +** See the [[robot-zip-leaf]] and [[robot-zip-tag]] settings |
| 277 | 280 | ** for additional controls associated with the "zipX" restriction. |
| 278 | 281 | ** |
| 279 | 282 | ** Change this setting "off" to disable all robot restrictions. |
| 280 | 283 | */ |
| 281 | 284 | /* |
| | @@ -324,19 +327,24 @@ |
| 324 | 327 | } |
| 325 | 328 | |
| 326 | 329 | /* |
| 327 | 330 | ** Return true if zTag matches one of the tags in the robot-restrict |
| 328 | 331 | ** setting. |
| 332 | +** |
| 333 | +** A zTag of "*" matches anything. |
| 329 | 334 | */ |
| 330 | 335 | static int robot_restrict_has_tag(const char *zTag){ |
| 331 | 336 | static const char *zGlob = 0; |
| 332 | 337 | if( zGlob==0 ){ |
| 333 | 338 | zGlob = db_get("robot-restrict",robot_restrict_default()); |
| 334 | 339 | if( zGlob==0 ) zGlob = ""; |
| 335 | 340 | } |
| 336 | 341 | if( zGlob[0]==0 || fossil_strcmp(zGlob, "off")==0 ){ |
| 337 | 342 | return 0; |
| 343 | + } |
| 344 | + if( zTag==0 || (zTag[0]=='*' && zTag[1]==0) ){ |
| 345 | + return 1; |
| 338 | 346 | } |
| 339 | 347 | return glob_multi_match(zGlob,zTag); |
| 340 | 348 | } |
| 341 | 349 | |
| 342 | 350 | /* |
| 343 | 351 | |