Fossil SCM

Do not allow the "fossil server" command to serve any static content file that contains ".fossil" anywhere in its name. This prevents repository files and/or their journals from being downloaded as static content.

drh 2012-12-01 02:57 trunk
Commit e726c8082ed4eb9370d4344732b3c1f35912a573
1 file changed +1 -1
+1 -1
--- src/main.c
+++ src/main.c
@@ -1413,11 +1413,11 @@
14131413
if( zPathInfo[i]=='/' && file_isdir(zRepo)==1 ){
14141414
fossil_free(zToFree);
14151415
i++;
14161416
continue;
14171417
}
1418
- if( file_isfile(zRepo) ){
1418
+ if( file_isfile(zRepo) && strglob("*.fossil*",zRepo)==0 ){
14191419
Blob content;
14201420
blob_read_from_file(&content, zRepo);
14211421
cgi_set_content_type(mimetype_from_name(zRepo));
14221422
cgi_set_content(&content);
14231423
cgi_reply();
14241424
--- src/main.c
+++ src/main.c
@@ -1413,11 +1413,11 @@
1413 if( zPathInfo[i]=='/' && file_isdir(zRepo)==1 ){
1414 fossil_free(zToFree);
1415 i++;
1416 continue;
1417 }
1418 if( file_isfile(zRepo) ){
1419 Blob content;
1420 blob_read_from_file(&content, zRepo);
1421 cgi_set_content_type(mimetype_from_name(zRepo));
1422 cgi_set_content(&content);
1423 cgi_reply();
1424
--- src/main.c
+++ src/main.c
@@ -1413,11 +1413,11 @@
1413 if( zPathInfo[i]=='/' && file_isdir(zRepo)==1 ){
1414 fossil_free(zToFree);
1415 i++;
1416 continue;
1417 }
1418 if( file_isfile(zRepo) && strglob("*.fossil*",zRepo)==0 ){
1419 Blob content;
1420 blob_read_from_file(&content, zRepo);
1421 cgi_set_content_type(mimetype_from_name(zRepo));
1422 cgi_set_content(&content);
1423 cgi_reply();
1424

Keyboard Shortcuts

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