X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=cgisimple.c;h=46ffb1518a528d1e57e67472e1adc6e5670ce9d4;hb=6233624691d9ee362ca9f6394307775dbb5fe3dc;hp=b416eb04bf9a203bd6ae5cc88cc24c49d4bb66c7;hpb=ef9441b4a85c15e8f446a1339e76ca693d9e6168;p=privoxy.git diff --git a/cgisimple.c b/cgisimple.c index b416eb04..46ffb151 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.93 2009/05/16 13:27:20 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.98 2010/03/27 18:29:59 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -9,7 +9,7 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.93 2009/05/16 13:27:20 fabian * Functions declared include: * * - * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -690,6 +690,13 @@ jb_err cgi_send_user_manual(struct client_state *csp, assert(rsp); assert(parameters); + if (0 == strncmpic(csp->config->usermanual, "http://", 7)) + { + log_error(LOG_LEVEL_CGI, "Request for local user-manual " + "received while user-manual delivery is disabled."); + return cgi_error_404(csp, rsp, parameters); + } + if (!parameters->first) { /* requested http://p.p/user-manual (without trailing slash) */ @@ -1071,7 +1078,7 @@ jb_err cgi_show_url_info(struct client_state *csp, * 1) "http://" or "https://" prefix present and followed by URL - OK * 2) Only the "http://" or "https://" part is present, no URL - change * to empty string so it will be detected later as "no URL". - * 3) Parameter specified but doesn't contain "http(s?)://" - add a + * 3) Parameter specified but doesn't start with "http(s?)://" - add a * "http://" prefix. * 4) Parameter not specified or is empty string - let this fall through * for now, next block of code will handle it. @@ -1098,9 +1105,14 @@ jb_err cgi_show_url_info(struct client_state *csp, url_param[0] = '\0'; } } - else if ((url_param[0] != '\0') && (NULL == strstr(url_param, "://"))) + else if ((url_param[0] != '\0') + && ((NULL == strstr(url_param, "://") + || (strstr(url_param, "://") > strstr(url_param, "/"))))) { - /* No prefix - assume http:// */ + /* + * No prefix or at least no prefix before + * the first slash - assume http:// + */ char *url_param_prefixed = strdup("http://"); if (JB_ERR_OK != string_join(&url_param_prefixed, url_param)) @@ -1491,6 +1503,12 @@ static jb_err show_defines(struct map *exports) { jb_err err = JB_ERR_OK; +#ifdef FEATURE_ACCEPT_FILTER + if (!err) err = map_conditional(exports, "FEATURE_ACCEPT_FILTER", 1); +#else /* ifndef FEATURE_ACCEPT_FILTER */ + if (!err) err = map_conditional(exports, "FEATURE_ACCEPT_FILTER", 0); +#endif /* ndef FEATURE_ACCEPT_FILTER */ + #ifdef FEATURE_ACL if (!err) err = map_conditional(exports, "FEATURE_ACL", 1); #else /* ifndef FEATURE_ACL */ @@ -1509,6 +1527,12 @@ static jb_err show_defines(struct map *exports) if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 0); #endif /* ndef FEATURE_CONNECTION_KEEP_ALIVE */ +#ifdef FEATURE_CONNECTION_SHARING + if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_SHARING", 1); +#else /* ifndef FEATURE_CONNECTION_SHARING */ + if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_SHARING", 0); +#endif /* ndef FEATURE_CONNECTION_SHARING */ + #ifdef FEATURE_FAST_REDIRECTS if (!err) err = map_conditional(exports, "FEATURE_FAST_REDIRECTS", 1); #else /* ifndef FEATURE_FAST_REDIRECTS */