Fossil SCM

Get chroot jails working correctly when a particular fossil repository is specified on the "http" command. This fixes a problem introduced by the multi-repository feature added by check-in [9cd2c42e79] on [2010-01-31].

drh 2010-03-31 18:42 trunk
Commit 42ba7b97aa3a479a12bc90b111bd72ce9e50fe81
2 files changed +5 +1
+5
--- src/main.c
+++ src/main.c
@@ -649,10 +649,14 @@
649649
if( stat(zRepo, &sStat)!=0 ){
650650
fossil_fatal("cannot stat() repository: %s", zRepo);
651651
}
652652
setgid(sStat.st_gid);
653653
setuid(sStat.st_uid);
654
+ if( g.db!=0 ){
655
+ db_close();
656
+ db_open_repository(zRepo);
657
+ }
654658
}
655659
#endif
656660
return zRepo;
657661
}
658662
@@ -692,10 +696,11 @@
692696
** characters other than alphanumerics, "-", and "_".
693697
*/
694698
for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){
695699
if( !isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_';
696700
}
701
+ if( zRepo[0]=='/' && zRepo[1]=='/' ) zRepo++;
697702
698703
if( file_size(zRepo)<1024 ){
699704
if( zNotFound ){
700705
cgi_redirect(zNotFound);
701706
}else{
702707
--- src/main.c
+++ src/main.c
@@ -649,10 +649,14 @@
649 if( stat(zRepo, &sStat)!=0 ){
650 fossil_fatal("cannot stat() repository: %s", zRepo);
651 }
652 setgid(sStat.st_gid);
653 setuid(sStat.st_uid);
 
 
 
 
654 }
655 #endif
656 return zRepo;
657 }
658
@@ -692,10 +696,11 @@
692 ** characters other than alphanumerics, "-", and "_".
693 */
694 for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){
695 if( !isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_';
696 }
 
697
698 if( file_size(zRepo)<1024 ){
699 if( zNotFound ){
700 cgi_redirect(zNotFound);
701 }else{
702
--- src/main.c
+++ src/main.c
@@ -649,10 +649,14 @@
649 if( stat(zRepo, &sStat)!=0 ){
650 fossil_fatal("cannot stat() repository: %s", zRepo);
651 }
652 setgid(sStat.st_gid);
653 setuid(sStat.st_uid);
654 if( g.db!=0 ){
655 db_close();
656 db_open_repository(zRepo);
657 }
658 }
659 #endif
660 return zRepo;
661 }
662
@@ -692,10 +696,11 @@
696 ** characters other than alphanumerics, "-", and "_".
697 */
698 for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){
699 if( !isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_';
700 }
701 if( zRepo[0]=='/' && zRepo[1]=='/' ) zRepo++;
702
703 if( file_size(zRepo)<1024 ){
704 if( zNotFound ){
705 cgi_redirect(zNotFound);
706 }else{
707
--- src/style.c
+++ src/style.c
@@ -407,8 +407,9 @@
407407
#if !defined(__MINGW32__)
408408
@ uid=%d(getuid()), gid=%d(getgid())<br>
409409
#endif
410410
@ g.zBaseURL = %h(g.zBaseURL)<br>
411411
@ g.zTop = %h(g.zTop)<br>
412
+ @ g.zRepositoryName = %h(g.zRepositoryName)<br>
412413
cgi_print_all();
413414
style_footer();
414415
}
415416
--- src/style.c
+++ src/style.c
@@ -407,8 +407,9 @@
407 #if !defined(__MINGW32__)
408 @ uid=%d(getuid()), gid=%d(getgid())<br>
409 #endif
410 @ g.zBaseURL = %h(g.zBaseURL)<br>
411 @ g.zTop = %h(g.zTop)<br>
 
412 cgi_print_all();
413 style_footer();
414 }
415
--- src/style.c
+++ src/style.c
@@ -407,8 +407,9 @@
407 #if !defined(__MINGW32__)
408 @ uid=%d(getuid()), gid=%d(getgid())<br>
409 #endif
410 @ g.zBaseURL = %h(g.zBaseURL)<br>
411 @ g.zTop = %h(g.zTop)<br>
412 @ g.zRepositoryName = %h(g.zRepositoryName)<br>
413 cgi_print_all();
414 style_footer();
415 }
416

Keyboard Shortcuts

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