From: Fabian Keil Date: Thu, 21 Sep 2006 12:54:43 +0000 (+0000) Subject: Fix +redirect{}. Didn't work with -fast-redirects. X-Git-Tag: v_3_0_5~23 X-Git-Url: http://www.privoxy.org/gitweb/?a=commitdiff_plain;h=95fe5bcbf0914d9800627d6f5d03dbae139295aa;p=privoxy.git Fix +redirect{}. Didn't work with -fast-redirects. --- diff --git a/filters.c b/filters.c index 1a1da409..399a507f 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.63 2006/08/31 10:11:28 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.64 2006/08/31 10:55:49 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -39,6 +39,10 @@ const char filters_rcs[] = "$Id: filters.c,v 1.63 2006/08/31 10:11:28 fabiankeil * * Revisions : * $Log: filters.c,v $ + * Revision 1.64 2006/08/31 10:55:49 fabiankeil + * Block requests for untrusted URLs with status + * code 403 instead of 200. + * * Revision 1.63 2006/08/31 10:11:28 fabiankeil * Don't free p which is still in use and will be later * freed by free_map(). Don't claim the referrer is unknown @@ -1139,7 +1143,7 @@ struct http_response *redirect_url(struct client_state *csp) { q = csp->action->string[ACTION_STRING_REDIRECT]; } - else + else if ((csp->action->flags & ACTION_FAST_REDIRECTS)) { redirect_mode = csp->action->string[ACTION_STRING_FAST_REDIRECTS]; if (0 == strcmpic(redirect_mode, "check-decoded-url")) @@ -1181,6 +1185,11 @@ struct http_response *redirect_url(struct client_state *csp) q = p++; } } + else + { + /* All redirection actions are disabled */ + return NULL; + } /* * if there was any, generate and return a HTTP redirect */ diff --git a/jcc.c b/jcc.c index 6184dc33..e902e19a 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.101 2006/09/06 09:23:37 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.102 2006/09/06 13:03:04 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,10 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.101 2006/09/06 09:23:37 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * Revision 1.102 2006/09/06 13:03:04 fabiankeil + * Respond with 400 and a short text message + * if the client tries to use Privoxy as FTP proxy. + * * Revision 1.101 2006/09/06 09:23:37 fabiankeil * Make number of retries in case of forwarded-connect problems * a config file option (forwarded-connect-retries) and use 0 as @@ -1235,8 +1239,7 @@ static void chat(struct client_state *csp) /* ..or a fast redirect kicked in */ #ifdef FEATURE_FAST_REDIRECTS - || (((csp->action->flags & ACTION_FAST_REDIRECTS) != 0) && - (NULL != (rsp = redirect_url(csp)))) + || ( NULL != (rsp = redirect_url(csp))) #endif /* def FEATURE_FAST_REDIRECTS */ )) )