[prev in list] [next in list] [prev in thread] [next in thread] 

List:       privoxy-commits
Subject:    [privoxy-commits] current filters.c,1.71,1.72
From:       noreply () sourceforge ! net
Date:       2006-12-22 18:52:56
Message-ID: E1GxpVo-00034s-GC () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/ijbswa/current
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27579

Modified Files:
	filters.c 
Log Message:
Modified is_untrusted_url to complain in case of
write errors and to give a reason when adding new
entries to the trustfile. Closes FR 1097611.

Index: filters.c
===================================================================
RCS file: /cvsroot/ijbswa/current/filters.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- filters.c	22 Dec 2006 14:24:52 -0000	1.71
+++ filters.c	22 Dec 2006 18:52:53 -0000	1.72
@@ -40,6 +40,11 @@
  *
  * Revisions   :
  *    $Log$
+ *    Revision 1.72  2006/12/22 18:52:53  fabiankeil
+ *    Modified is_untrusted_url to complain in case of
+ *    write errors and to give a reason when adding new
+ *    entries to the trustfile. Closes FR 1097611.
+ *
  *    Revision 1.71  2006/12/22 14:24:52  fabiankeil
  *    Skip empty filter files in pcrs_filter_response,
  *    but don't ignore the ones that come afterwards.
@@ -1570,7 +1575,7 @@
       {
          /* if the URL's referrer is from a trusted referrer, then
           * add the target spec to the trustfile as an unblocked
-          * domain and return NULL (which means it's OK).
+          * domain and return 0 (which means it's OK).
           */
 
          FILE *fp;
@@ -1601,9 +1606,19 @@
                string_join(&new_entry, path);
             }
 
+            /*
+             * Give a reason for generating this entry.
+             */
+            string_append(&new_entry, " # Trusted referrer was: ");
+            string_append(&new_entry, referer);
+
             if (new_entry != NULL)
             {
-               fprintf(fp, "%s\n", new_entry);
+               if (-1 == fprintf(fp, "%s\n", new_entry))
+               {
+                  log_error(LOG_LEVEL_ERROR, "Failed to append \'%s\' to trustfile \'%s\': %E",
+                     new_entry, csp->config->trustfile);
+               }
                free(new_entry);
             }
             else
@@ -1614,6 +1629,11 @@
 
             fclose(fp);
          }
+         else
+         {
+            log_error(LOG_LEVEL_ERROR, "Failed to append new entry for \'%s\' to trustfile \'%s\': %E",
+               csp->http->hostport, csp->config->trustfile);
+         }
          return 0;
       }
    }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ijbswa-commits mailing list
ijbswa-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ijbswa-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic