I was toying with fossil as cgi on win7. I installed the Abyss server and setup a cgi-bin/fossil:

#!C:/bin/fossil.exe
directory: C:/Progra~1/AbyssW~1/htdocs/FossilRepositories
notfound: /badfossil.php

with badfossil.php being:

<html>
  <body>
    <h1>Fossil Repository Not Found</h1>
      <?php phpinfo(); ?>
  </body>
</html>


When I used a URL to a non-existent repository:

http:://localhost/cgi-bin/fossil/bogus

It does run /badfossil.php -- but there seems to be no way to issue an error message referring to "bogus". I can find nothing in the server supplied environment that lets me identify a more specific error than a generic "fossil repository not found".

I am just wondering if there would be some way to be more specific. Maybe have the "badfossil.php" be run with some arguments? Maybe the original URL?

I tried this naive patch:


--- main.c.orig 2018-03-17 14:22:53.994344800 -0500
+++ main.c      2018-03-22 15:08:22.098101700 -0500
@@ -1539,7 +1539,14 @@
                   && repo_list_page() ){
           /* Will return a list of repositories */
         }else if( zNotFound ){
+#if 1
+char t[1000];
+strcpy( t, zNotFound );
+strcat( t, "?repo=missing.fossil" );
+cgi_redirect(t);
+#else
           cgi_redirect(zNotFound);
+#endif
         }else{
 #ifdef FOSSIL_ENABLE_JSON
           if(g.json.isJsonMode){


This does work. PHP tells me:

$_REQUEST['repo']       missing.fossil
$_GET['repo']   missing.fossil
$_SERVER['QUERY_STRING']        repo=missing.fossil
$_SERVER['SCRIPT_URL']  /badfossil.php?repo=missing.fossil
$_SERVER['SCRIPT_URI']  http://localhost/badfossil.php?repo=missing.fossil
$_SERVER['REQUEST_URI'] /badfossil.php?repo=missing.fossil

It looks to me that it is feasible to provide more information on the notfound url. I do not know if my patch above is the right place to start or whether it might mess something else up.
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to