Branch: Tag:

1998-05-25

1998-05-25 16:43:12 by Per Hedbor <ph@opera.com>

Fixes to hide confident information in the request debug

Rev: server/protocols/http.pike:1.104

6: Inside #if defined(MAGIC_ERROR)
  #ifdef MAGIC_ERROR   inherit "highlight_pike";   #endif - constant cvs_version = "$Id: http.pike,v 1.103 1998/05/22 01:51:31 neotron Exp $"; + constant cvs_version = "$Id: http.pike,v 1.104 1998/05/25 16:43:12 per Exp $";   // HTTP protocol module.   #include <config.h>   private inherit "roxenlib";
751:    return res+"</body>";   }    - string generate_bugreport(array from) + string generate_bugreport(array from, string u, string rd)   {    add_id(from);    return ("<pre>"+html_encode_string("Roxen version: "+version()+ -  (roxen->real_version != version()?" ("+roxen->real_version+")":"")+ -  "\nRequested URL: "+not_query+(query?"?"+query:"")+"\n" +  (roxen->real_version != version()? +  " ("+roxen->real_version+")":"")+ +  "\nRequested URL: "+u+"\n"    "\nError: "+    describe_backtrace(from)-(getcwd()+"/")+ -  "\n\nRequest data:\n"+raw)); +  "\n\nRequest data:\n"+rd));   }    -  + string censor(string what) + { +  string a, b, c; +  if(sscanf(what, "%shorization:%s\n%s", a, b, c)==3) +  return a+" ################ (censored)\n"+c; +  return what; + } +    int store_error(array err)   {    mapping e = roxen->query_var("errors");
770:       int id = ++e[0];    if(id>1024) id = 1; -  e[id] = err; +  e[id] = ({err,raw_url,censor(raw)});    return id;   }   
1103: Inside #if defined(MAGIC_ERROR)
   {    file = ([    "type":"text/html", -  "data":generate_bugreport( err ), +  "data":generate_bugreport( @err ),    ]);    } else {   
1120: Inside #if defined(MAGIC_ERROR)
   else    file = ([    "type":"text/html", -  "data":handle_error_file_request( err, (int)variables->error ), +  "data":handle_error_file_request( err[0], +  (int)variables->error ),    ]);    }    }