diff options
author | Cédric Krier <cedk@gentoo.org> | 2006-07-02 14:20:28 +0000 |
---|---|---|
committer | Cédric Krier <cedk@gentoo.org> | 2006-07-02 14:20:28 +0000 |
commit | c6278473cb58e70ad25174e13deeed7b690d7b0d (patch) | |
tree | 7e86fec33cba7a8877c2ae7e6ae22045aebd9cd1 | |
parent | media-tv/democracy: add firefox support thanks to Rick Harris, add ~ppc and p... (diff) | |
download | sunrise-c6278473cb58e70ad25174e13deeed7b690d7b0d.tar.gz sunrise-c6278473cb58e70ad25174e13deeed7b690d7b0d.tar.bz2 sunrise-c6278473cb58e70ad25174e13deeed7b690d7b0d.zip |
net-proxy/squidclamav: net-proxy/squidclamav - bug 138855
svn path=/sunrise/; revision=424
-rw-r--r-- | net-proxy/squidclamav/ChangeLog | 7 | ||||
-rw-r--r-- | net-proxy/squidclamav/Manifest | 28 | ||||
-rw-r--r-- | net-proxy/squidclamav/files/digest-squidclamav-2.3 | 3 | ||||
-rw-r--r-- | net-proxy/squidclamav/files/squidclamav-2.3-conf.patch | 16 | ||||
-rw-r--r-- | net-proxy/squidclamav/files/squidclamav-2.3-log.patch | 506 | ||||
-rw-r--r-- | net-proxy/squidclamav/files/squidclamav-2.3-makefile.patch | 23 | ||||
-rw-r--r-- | net-proxy/squidclamav/files/squidclamav-2.3-path.patch | 15 | ||||
-rw-r--r-- | net-proxy/squidclamav/squidclamav-2.3.ebuild | 52 |
8 files changed, 650 insertions, 0 deletions
diff --git a/net-proxy/squidclamav/ChangeLog b/net-proxy/squidclamav/ChangeLog new file mode 100644 index 000000000..3b40affb7 --- /dev/null +++ b/net-proxy/squidclamav/ChangeLog @@ -0,0 +1,7 @@ +# ChangeLog for net-proxy/squidclamav +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + + 02 Jul 2006; Cedric Krier <ced@ced.homedns.org> ChangeLog: + New Ebuild for bug 138855 + diff --git a/net-proxy/squidclamav/Manifest b/net-proxy/squidclamav/Manifest new file mode 100644 index 000000000..23f1266da --- /dev/null +++ b/net-proxy/squidclamav/Manifest @@ -0,0 +1,28 @@ +AUX squidclamav-2.3-conf.patch 509 RMD160 eec6e1a9d29fe7d81b56bb464b7a0715f113dbc2 SHA1 a244a7ace38c2dffa6dc2527b2e0c60a1ab47db6 SHA256 8a5954fa7e4e8f1377f264eec6702374cf38a6f3d997f4821e08f25b282298c6 +MD5 59224c1be016db33bb053aaa81dad1ec files/squidclamav-2.3-conf.patch 509 +RMD160 eec6e1a9d29fe7d81b56bb464b7a0715f113dbc2 files/squidclamav-2.3-conf.patch 509 +SHA256 8a5954fa7e4e8f1377f264eec6702374cf38a6f3d997f4821e08f25b282298c6 files/squidclamav-2.3-conf.patch 509 +AUX squidclamav-2.3-log.patch 16612 RMD160 1c75c264554513ddd9d75f43b01a9de0ce36aea1 SHA1 5fce3fcf79ab44aa37fa2f80867d866de786c419 SHA256 3b3bdf91c49164f4723a76b5654f1ea4d48d3fd8bc90883d061802b87265543a +MD5 3402744e406fb5b78b88c2aee1a0275e files/squidclamav-2.3-log.patch 16612 +RMD160 1c75c264554513ddd9d75f43b01a9de0ce36aea1 files/squidclamav-2.3-log.patch 16612 +SHA256 3b3bdf91c49164f4723a76b5654f1ea4d48d3fd8bc90883d061802b87265543a files/squidclamav-2.3-log.patch 16612 +AUX squidclamav-2.3-makefile.patch 607 RMD160 ed89a8677b87726f201b9fd6074fd59d3df83212 SHA1 177b9f246667153881f69645cffccb8d69dcd788 SHA256 e68688e141e3c0d34983584fcdfa3fc9142f6bb8543d13477342f9d7b908d699 +MD5 73493d31ff28f004176314db59d81682 files/squidclamav-2.3-makefile.patch 607 +RMD160 ed89a8677b87726f201b9fd6074fd59d3df83212 files/squidclamav-2.3-makefile.patch 607 +SHA256 e68688e141e3c0d34983584fcdfa3fc9142f6bb8543d13477342f9d7b908d699 files/squidclamav-2.3-makefile.patch 607 +AUX squidclamav-2.3-path.patch 664 RMD160 c8f08d1cda6e202de090e56761ee7a4af1bc89cb SHA1 7e739f282107ae2dd6f3d26f28180ca26fa4c9b7 SHA256 8e78c40c3cff8339d1db31634e0831ba6873b57fbc3cac467a0e32fa9aba38a4 +MD5 71327b12d43a8eb197a29f5c8acf07a6 files/squidclamav-2.3-path.patch 664 +RMD160 c8f08d1cda6e202de090e56761ee7a4af1bc89cb files/squidclamav-2.3-path.patch 664 +SHA256 8e78c40c3cff8339d1db31634e0831ba6873b57fbc3cac467a0e32fa9aba38a4 files/squidclamav-2.3-path.patch 664 +DIST squidclamav-2.3.tar.gz 329886 RMD160 529903b52e722aa299c746f4c42c7ea211683a1e SHA1 a6b99bae74f448ef69a82d18fd0f65c2968bc265 SHA256 75df9938df135f79791861f9f4944f71b55940a0cf1696cf2023a43c50dd91ed +EBUILD squidclamav-2.3.ebuild 1277 RMD160 d8cf464204b0a50583794310e43ec9da905b128f SHA1 03ae4072bdfd46b30f4d7341be2ec9f91fbed0d8 SHA256 80107001bf38abaa23da12307bb41d299526b78feaac1eeee017ac49721b3520 +MD5 72d8d52fd348707c9046e026fa9610d1 squidclamav-2.3.ebuild 1277 +RMD160 d8cf464204b0a50583794310e43ec9da905b128f squidclamav-2.3.ebuild 1277 +SHA256 80107001bf38abaa23da12307bb41d299526b78feaac1eeee017ac49721b3520 squidclamav-2.3.ebuild 1277 +MISC ChangeLog 212 RMD160 e1386265f684c00ccdfb315a508fb12789589212 SHA1 aa92b14da7e3d1540a416c7e0ce6f0756e8467ca SHA256 ba1d2ee1c8f20b4bcfb1e3d99016fd66d2a7aaba3c1134bd2a0066ed4ca91129 +MD5 b7c01685a366c499c397be8cb50da8ee ChangeLog 212 +RMD160 e1386265f684c00ccdfb315a508fb12789589212 ChangeLog 212 +SHA256 ba1d2ee1c8f20b4bcfb1e3d99016fd66d2a7aaba3c1134bd2a0066ed4ca91129 ChangeLog 212 +MD5 49c04927827b1cc86d2065dd4d66d17d files/digest-squidclamav-2.3 247 +RMD160 1a69964a53d33031009216890b0b6a17a24a424d files/digest-squidclamav-2.3 247 +SHA256 90ec2a310828db42e662bedbc189516f7eb8742059ad701433004a1c8fe212e2 files/digest-squidclamav-2.3 247 diff --git a/net-proxy/squidclamav/files/digest-squidclamav-2.3 b/net-proxy/squidclamav/files/digest-squidclamav-2.3 new file mode 100644 index 000000000..d0e2d4c1a --- /dev/null +++ b/net-proxy/squidclamav/files/digest-squidclamav-2.3 @@ -0,0 +1,3 @@ +MD5 e4c44069852627e53f9dd69ea9c14974 squidclamav-2.3.tar.gz 329886 +RMD160 529903b52e722aa299c746f4c42c7ea211683a1e squidclamav-2.3.tar.gz 329886 +SHA256 75df9938df135f79791861f9f4944f71b55940a0cf1696cf2023a43c50dd91ed squidclamav-2.3.tar.gz 329886 diff --git a/net-proxy/squidclamav/files/squidclamav-2.3-conf.patch b/net-proxy/squidclamav/files/squidclamav-2.3-conf.patch new file mode 100644 index 000000000..87fb2d246 --- /dev/null +++ b/net-proxy/squidclamav/files/squidclamav-2.3-conf.patch @@ -0,0 +1,16 @@ +--- squidclamav~/squidclamav.conf.dist 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/squidclamav.conf.dist 2006-07-02 14:18:35.000000000 +0200 +@@ -30,11 +30,11 @@ + # Examples of valid lines: + # + # proxy http://127.0.0.1:3128/ +-# logfile /usr/local/squidclamav/logs/squidclamav.log ++# logfile /var/log/squidclamav/squidclamav.log + # redirect http://proxy.domain.com/cgi-bin/clwarn.cgi + # debug 0 + # force 1 +-# clamd_ip 192.168.1.5 ++# clamd_ip 127.0.0.1 + # clamd_port 3310 + # timeout 60 + # abort ^.*\.gz$ diff --git a/net-proxy/squidclamav/files/squidclamav-2.3-log.patch b/net-proxy/squidclamav/files/squidclamav-2.3-log.patch new file mode 100644 index 000000000..c87a69401 --- /dev/null +++ b/net-proxy/squidclamav/files/squidclamav-2.3-log.patch @@ -0,0 +1,506 @@ +diff -ur squidclamav~/config.c squidclamav/config.c +--- squidclamav~/config.c 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/config.c 2006-06-30 18:26:29.000000000 +0200 +@@ -73,15 +73,15 @@ + + + if(fp == NULL) { +- log(log_file, "unable to open configuration file\n"); ++ log_SC(log_file, "unable to open configuration file\n"); + bridge_mode = 1; + return; + } + + if(alternate_config != NULL) +- log(log_file, "Reading configuration from %s\n", alternate_config); ++ log_SC(log_file, "Reading configuration from %s\n", alternate_config); + else +- log(log_file, "Reading configuration from %s\n", CONFIG_FILE); ++ log_SC(log_file, "Reading configuration from %s\n", CONFIG_FILE); + + while(!bridge_mode && (fgets(buff, MAX_BUFF, fp) != NULL)) { + +@@ -96,7 +96,7 @@ + } + } + if (redirect_url == NULL) { +- log(log_file, "No redirection URL set, going to BRIDGE mode\n"); ++ log_SC(log_file, "No redirection URL set, going to BRIDGE mode\n"); + bridge_mode = 1; + } + +@@ -127,7 +127,7 @@ + + + if((stored < 2) || (stored > 4)) { +- log(log_file, ++ log_SC(log_file, + "unable to get a pair of patterns in add_to_patterns() " + "for [%s]\n", pattern); + bridge_mode = 1; +@@ -208,7 +208,7 @@ + } + + if(regcomp(&compiled, first, regex_flags)) { +- log(log_file, "Invalid regex [%s] in pattern file\n", first); ++ log_SC(log_file, "Invalid regex [%s] in pattern file\n", first); + bridge_mode = 1; + return; + } +@@ -217,7 +217,7 @@ + + rpattern.pattern = (char *)malloc(sizeof(char) * (strlen(first) +1)); + if(rpattern.pattern == NULL) { +- log(log_file, "unable to allocate memory in add_to_patterns()\n"); ++ log_SC(log_file, "unable to allocate memory in add_to_patterns()\n"); + bridge_mode = 1; + return; + } +@@ -225,7 +225,7 @@ + + rpattern.replacement = (char *)malloc(sizeof(char) * (strlen(second) +1)); + if(rpattern.replacement == NULL) { +- log(log_file, "unable to allocate memory in add_to_patterns()\n"); ++ log_SC(log_file, "unable to allocate memory in add_to_patterns()\n"); + bridge_mode = 1; + return; + } +@@ -247,7 +247,7 @@ + rpattern.case_sensitive); + + if(rpattern.accel == NULL) { +- log(log_file, "unable to allocate memory from get_accel()\n"); ++ log_SC(log_file, "unable to allocate memory from get_accel()\n"); + bridge_mode = 1; + return; + } +diff -ur squidclamav~/lists.c squidclamav/lists.c +--- squidclamav~/lists.c 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/lists.c 2006-06-30 18:26:49.000000000 +0200 +@@ -80,7 +80,7 @@ + + new = (struct IP_item *)malloc(sizeof(struct IP_item)); + if(new == NULL) { +- log(log_file, "unable to allocate memory in add_to_ip_list()\n"); ++ log_SC(log_file, "unable to allocate memory in add_to_ip_list()\n"); + bridge_mode = 1; + return 1; + } +@@ -119,7 +119,7 @@ + + new = (struct pattern_item *)malloc(sizeof(struct pattern_item)); + if(new == NULL) { +- log(log_file, "unable to allocate memory in add_to_plist()\n"); ++ log_SC(log_file, "unable to allocate memory in add_to_plist()\n"); + /* exit(3); */ + bridge_mode = 1; + return; +diff -ur squidclamav~/log.c squidclamav/log.c +--- squidclamav~/log.c 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/log.c 2006-06-30 18:27:09.000000000 +0200 +@@ -48,7 +48,7 @@ + + extern int interactive; /* from main.c */ + +-void log(char *filename, char *format, ...) ++void log_SC(char *filename, char *format, ...) + { + FILE *log; + char *date_str = NULL; +diff -ur squidclamav~/log.h squidclamav/log.h +--- squidclamav~/log.h 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/log.h 2006-06-30 18:27:24.000000000 +0200 +@@ -41,9 +41,9 @@ + + + #ifdef __GNUC__ +-void log(char *, char *, ...) __attribute__ ((format (printf, 2, 3))); ++void log_SC(char *, char *, ...) __attribute__ ((format (printf, 2, 3))); + #else +-void log(char *, char *, ...); ++void log_SC(char *, char *, ...); + #endif + char *get_date(void); + +diff -ur squidclamav~/main.c squidclamav/main.c +--- squidclamav~/main.c 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/main.c 2006-06-30 18:28:04.000000000 +0200 +@@ -99,7 +99,7 @@ + void + sigalarm (int sig) + { +- log (log_file, "Timeout waiting for clamd response\n"); ++ log_SC (log_file, "Timeout waiting for clamd response\n"); + exit (3); + } + +@@ -111,20 +111,20 @@ + int msize = data_size * nmemb; + + if (debug) +- log (log_file, "Scanning data received against clamd stream\n"); ++ log_SC (log_file, "Scanning data received against clamd stream\n"); + if (debug) +- log (log_file, "Sending data to clamd\n"); ++ log_SC (log_file, "Sending data to clamd\n"); + ret = write (wsockd, ptr, msize); + if (ret <= 0) + { + if (debug) +- log (log_file, "Can't write to clamd socket.\n"); ++ log_SC (log_file, "Can't write to clamd socket.\n"); + close (wsockd); + } + else + { + if (debug) +- log (log_file, "Write %d bytes on %d to socket\n", ret, msize); ++ log_SC (log_file, "Write %d bytes on %d to socket\n", ret, msize); + } + + return msize; +@@ -216,13 +216,13 @@ + signal (SIGTERM, sigterm); + + if (bridge_mode) +- log (log_file, "Invalid condition - continuing in BRIDGE mode\n"); ++ log_SC (log_file, "Invalid condition - continuing in BRIDGE mode\n"); + +- log (log_file, "SquidClamav (PID %d) started\n", (int) getpid ()); ++ log_SC (log_file, "SquidClamav (PID %d) started\n", (int) getpid ()); + + if (bridge_mode) + { +- log (log_file, "Invalid condition - continuing in BRIDGE mode\n"); ++ log_SC (log_file, "Invalid condition - continuing in BRIDGE mode\n"); + } + else + { +@@ -232,10 +232,10 @@ + /* get an easy handle */ + if ((eh = curl_easy_init ()) == NULL) + { +- log (log_file, "Curl easy initialization failed\n"); ++ log_SC (log_file, "Curl easy initialization failed\n"); + curl_global_cleanup (); + bridge_mode = 1; +- log (log_file, "Invalid condition - continuing in BRIDGE mode\n"); ++ log_SC (log_file, "Invalid condition - continuing in BRIDGE mode\n"); + } + else + { +@@ -298,7 +298,7 @@ + { + + if (debug) +- log (log_file, "No antivir check for url:%s\n", in_buff.url); ++ log_SC (log_file, "No antivir check for url:%s\n", in_buff.url); + + /* no replacement for the URL was found */ + fprintf (stdout, "\n"); +@@ -320,11 +320,11 @@ + { + if (force == 0) { + /* no header so just go back to squid */ +- log (log_file, "No header from url %s\n", in_buff.url); ++ log_SC (log_file, "No header from url %s\n", in_buff.url); + fprintf (stdout, "\n"); + continue; + } else { +- log (log_file, "Force scanning ... No header from url %s\n", in_buff.url); ++ log_SC (log_file, "Force scanning ... No header from url %s\n", in_buff.url); + force_scan = 1; + } + } +@@ -334,12 +334,12 @@ + != CURLE_OK) + { + /* not ok --> squid should handle this */ +- log (log_file, "No content length from url %s\n", in_buff.url); ++ log_SC (log_file, "No content length from url %s\n", in_buff.url); + fprintf (stdout, "\n"); + continue; + } + if (debug) +- log (log_file, "File size is %'.2f\n", usize); ++ log_SC (log_file, "File size is %'.2f\n", usize); + + /* get the CONTENT_TYPE out of the header */ + if (check_content_type == 1) +@@ -348,18 +348,18 @@ + CURLE_OK) + { + /* not ok --> squid should handle this */ +- log (log_file, "No content type from url %s\n", ++ log_SC (log_file, "No content type from url %s\n", + in_buff.url); + fprintf (stdout, "\n"); + continue; + } + if (debug) +- log (log_file, "Content type is %s\n", p); ++ log_SC (log_file, "Content type is %s\n", p); + if ((p == NULL) || (pattern_compare (p) == 0)) + { + + if (debug) +- log (log_file, "No antivir check for content-type: %s\n", ++ log_SC (log_file, "No antivir check for content-type: %s\n", + p); + /* no replacement for the URL was found */ + fprintf (stdout, "\n"); +@@ -372,16 +372,16 @@ + /***** Open a socket to Clamd daemon *****/ + if ((sockd = dconnect ()) < 0) + { +- log (log_file, "Can't connect to Clamd daemon\n"); ++ log_SC (log_file, "Can't connect to Clamd daemon\n"); + fprintf (stdout, "\n"); + return -1; + } + if (debug) +- log (log_file, "Sending STREAM to clamd.\n"); ++ log_SC (log_file, "Sending STREAM to clamd.\n"); + + if (write (sockd, "STREAM", 6) <= 0) + { +- log (log_file, "Can't write to Clamd socket.\n"); ++ log_SC (log_file, "Can't write to Clamd socket.\n"); + fprintf (stdout, "\n"); + return -1; + } +@@ -400,17 +400,17 @@ + } + if (!loopw) + { +- log (log_file, "Clamd daemon not ready for stream scanning.\n"); ++ log_SC (log_file, "Clamd daemon not ready for stream scanning.\n"); + fprintf (stdout, "\n"); + return -1; + } + if (debug) +- log (log_file, "Received port %d from clamd.\n", port); ++ log_SC (log_file, "Received port %d from clamd.\n", port); + + /* connect to clamd given port */ + if ((wsockd = socket (AF_INET, SOCK_STREAM, 0)) < 0) + { +- log (log_file, "Can't create the Clamd socket.\n"); ++ log_SC (log_file, "Can't create the Clamd socket.\n"); + fprintf (stdout, "\n"); + return -1; + } +@@ -421,7 +421,7 @@ + peer_size = sizeof (peer); + if (getpeername (sockd, (struct sockaddr *) &peer, &peer_size) < 0) + { +- log (log_file, "Can't get socket peer name.\n"); ++ log_SC (log_file, "Can't get socket peer name.\n"); + fprintf (stdout, "\n"); + return -1; + } +@@ -434,20 +434,20 @@ + server.sin_addr.s_addr = peer.sin_addr.s_addr; + break; + default: +- log (log_file, "Unexpected socket type: %d.\n", ++ log_SC (log_file, "Unexpected socket type: %d.\n", + peer.sin_family); + return -1; + } + + if (debug) +- log (log_file, "Trying to connect to clamd [port: %d].\n", port); ++ log_SC (log_file, "Trying to connect to clamd [port: %d].\n", port); + + if (connect + (wsockd, (struct sockaddr *) &server, + sizeof (struct sockaddr_in)) < 0) + { + close (wsockd); +- log (log_file, "Can't connect to clamd [port: %d].\n", port); ++ log_SC (log_file, "Can't connect to clamd [port: %d].\n", port); + fprintf (stdout, "\n"); + return -1; + } +@@ -463,26 +463,26 @@ + curl_easy_setopt (eh, CURLOPT_HTTPGET, TRUE); + if (curl_easy_perform (eh) != 0) + { +- log (log_file, "Error when downloading url %s\n", in_buff.url); +- log (log_file, "CURLOPT_ERRORBUFFER: %s\n", err); ++ log_SC (log_file, "Error when downloading url %s\n", in_buff.url); ++ log_SC (log_file, "CURLOPT_ERRORBUFFER: %s\n", err); + fprintf (stdout, "\n"); + continue; + } + + close (wsockd); + if (debug) +- log (log_file, "Connection to clamd on port: %d closed.\n", port); ++ log_SC (log_file, "Connection to clamd on port: %d closed.\n", port); + if (debug) +- log (log_file, "Reading clamd scan result.\n"); ++ log_SC (log_file, "Reading clamd scan result.\n"); + while ((nbread = read (sockd, cbuff, sizeof (cbuff))) > 0) + { + if (debug) +- log (log_file, "received: %s", cbuff); ++ log_SC (log_file, "received: %s", cbuff); + if (strstr (cbuff, "FOUND\n")) + { + sprintf (urlredir, "%s?url=%s&source=%s&user=%s&virus=%s", + redirect_url,in_buff.url,in_buff.src_address,in_buff.ident,cbuff); +- log (log_file, "Redirecting URL to: %s\n", urlredir); ++ log_SC (log_file, "Redirecting URL to: %s\n", urlredir); + replace (urlredir, " ", "+"); + strcpy (in_buff.url, urlredir); + } +@@ -490,19 +490,19 @@ + } + close (sockd); + if (debug) +- log (log_file, "End reading clamd scan result.\n"); ++ log_SC (log_file, "End reading clamd scan result.\n"); + + if (strlen (urlredir) > 0) + { + if (debug) +- log (log_file, "Virus found send redirection to Squid.\n"); ++ log_SC (log_file, "Virus found send redirection to Squid.\n"); + fprintf (stdout, "%s %s %s %s\n", in_buff.url, + in_buff.src_address, in_buff.ident, in_buff.method); + } + else + { + if (debug) +- log (log_file, "No virus detected for URL: %s.\n", ++ log_SC (log_file, "No virus detected for URL: %s.\n", + in_buff.url); + fprintf (stdout, "\n"); + } +@@ -526,7 +526,7 @@ + sighup () + { + signal (SIGHUP, sighup); /* reset signal */ +- log (log_file, "Sighup received, reloading virus database...\n"); ++ log_SC (log_file, "Sighup received, reloading virus database...\n"); + /* simply terminate the program, squid should reload it */ + /* cleanup */ + curl_global_cleanup (); +@@ -541,7 +541,7 @@ + sigterm () + { + signal (SIGTERM, sigterm); /* reset signal */ +- log (log_file, "Sigterm received, cleaning all before quit...\n"); ++ log_SC (log_file, "Sigterm received, cleaning all before quit...\n"); + /* cleanup */ + curl_global_cleanup (); + free (redirect_url); +@@ -569,7 +569,7 @@ + strncpy (userver.sun_path, clamd_local, sizeof(userver.sun_path)); + if ((asockd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) + { +- log (log_file, "Can't bind local socket on %s.\n", clamd_local); ++ log_SC (log_file, "Can't bind local socket on %s.\n", clamd_local); + return -1; + } + if (connect +@@ -577,7 +577,7 @@ + sizeof (struct sockaddr_un)) < 0) + { + close (asockd); +- log (log_file, "Can't connect to clamd on local socket %s.\n", clamd_local); ++ log_SC (log_file, "Can't connect to clamd on local socket %s.\n", clamd_local); + return -1; + } + +@@ -588,7 +588,7 @@ + + if ((asockd = socket (AF_INET, SOCK_STREAM, 0)) < 0) + { +- log (log_file, "Can't create the socket.\n"); ++ log_SC (log_file, "Can't create the socket.\n"); + return -1; + } + +@@ -598,7 +598,7 @@ + if ((he = gethostbyname (clamd_ip)) == 0) + { + close (asockd); +- log (log_file, "Can't lookup clamd hostname.\n"); ++ log_SC (log_file, "Can't lookup clamd hostname.\n"); + return -1; + } + server.sin_addr = *(struct in_addr *) he->h_addr_list[0]; +@@ -608,7 +608,7 @@ + sizeof (struct sockaddr_in)) < 0) + { + close (asockd); +- log (log_file, "Can't connect to clamd.\n"); ++ log_SC (log_file, "Can't connect to clamd.\n"); + return -1; + } + } +diff -ur squidclamav~/squidclamav.c squidclamav/squidclamav.c +--- squidclamav~/squidclamav.c 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/squidclamav.c 2006-06-30 18:29:02.000000000 +0200 +@@ -81,16 +81,16 @@ + + + if(converted != 4) { +- log(log_file, "%d = incorrect number of scanned fields\n", converted); ++ log_SC(log_file, "%d = incorrect number of scanned fields\n", converted); + return 1; + } + + if (debug) +- log(log_file, "Request:%s %s %s %s\n", in_buff->url, in_buff->src_address, in_buff->ident, in_buff->method); ++ log_SC(log_file, "Request:%s %s %s %s\n", in_buff->url, in_buff->src_address, in_buff->ident, in_buff->method); + + /* check the source IP address */ + if(strcmp(in_buff->src_address, "") == 0) { +- log(log_file, "in_buff.src_address is NULL in main()\n"); ++ log_SC(log_file, "in_buff.src_address is NULL in main()\n"); + return 1; + } + +@@ -99,21 +99,21 @@ + if((strcmp(in_buff->method, "") == 0) || + (strcmp(in_buff->method, "GET"))) { + if (debug) +- log(log_file, "in_buff.method not \"GET\"\n"); ++ log_SC(log_file, "in_buff.method not \"GET\"\n"); + return 1; + } + + /* handle the error condition in which 4 arguments not parsed, + in which we just print buff to stdout */ + if(strlen(in_buff->url) <= 4) { +- log(log_file, "strlen in_buff->url = [%d] in main()\n", ++ log_SC(log_file, "strlen in_buff->url = [%d] in main()\n", + strlen(in_buff->url)); + return 1; + } + + /* check that the IP source address supplied is valid */ + if(get_ip(in_buff->src_address,&address)) { +- log(log_file, "in_buff.src_address not valid\n"); ++ log_SC(log_file, "in_buff.src_address not valid\n"); + return 1; + } + +@@ -141,11 +141,11 @@ + free(new_string); + if(curr->patterns.type == ABORT) { + if (debug) +- log(log_file, "abort matched: %s\n", url); ++ log_SC(log_file, "abort matched: %s\n", url); + return -1; + } else { + if (debug) +- log(log_file, "regex matched: %s\n", url); ++ log_SC(log_file, "regex matched: %s\n", url); + return 1; + } + } diff --git a/net-proxy/squidclamav/files/squidclamav-2.3-makefile.patch b/net-proxy/squidclamav/files/squidclamav-2.3-makefile.patch new file mode 100644 index 000000000..33b7a925f --- /dev/null +++ b/net-proxy/squidclamav/files/squidclamav-2.3-makefile.patch @@ -0,0 +1,23 @@ +--- squidclamav~/Makefile 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/Makefile 2006-06-30 18:38:02.000000000 +0200 +@@ -1,9 +1,9 @@ + # Makefile for SquidClamav + # + +-OFILES = squidclamav.o main.o config.o log.o lists.o regex.o ++OFILES = squidclamav.o main.o config.o log.o lists.o + +-HFILES = squidclamav.h paths.h lists.h log.h regex.h ++HFILES = squidclamav.h paths.h lists.h log.h + + CC=gcc + #CC=checkergcc +@@ -13,7 +13,7 @@ + + BINARIES = squidclamav + +-CFLAGS = -O3 -Wall -funroll-loops -fno-builtin-log ++CFLAGS ?= -O3 -Wall -funroll-loops -fno-builtin-log + #CFLAGS = -Wall -g + + all: $(BINARIES) diff --git a/net-proxy/squidclamav/files/squidclamav-2.3-path.patch b/net-proxy/squidclamav/files/squidclamav-2.3-path.patch new file mode 100644 index 000000000..0f744c6a7 --- /dev/null +++ b/net-proxy/squidclamav/files/squidclamav-2.3-path.patch @@ -0,0 +1,15 @@ +--- squidclamav~/paths.h 2006-06-30 18:17:32.000000000 +0200 ++++ squidclamav/paths.h 2006-06-30 18:41:49.000000000 +0200 +@@ -25,10 +25,10 @@ + + /************* Log File Locations (must be writable by **********/ + /************* the user given in the squid.conf file **********/ +-#define LOG_FILE "/usr/local/squidclamav/logs/squidclamav.log" ++#define LOG_FILE "/var/log/squidclamav/squidclamav.log" + + /************* Configuration file locations ***********/ +-#define CONFIG_FILE "/usr/local/squidclamav/etc/squidclamav.conf" ++#define CONFIG_FILE "/etc/squidclamav.conf" + + /************* Proxy to use *************/ + #define MY_PROXY "http://127.0.0.1:3128" diff --git a/net-proxy/squidclamav/squidclamav-2.3.ebuild b/net-proxy/squidclamav/squidclamav-2.3.ebuild new file mode 100644 index 000000000..49a323b0e --- /dev/null +++ b/net-proxy/squidclamav/squidclamav-2.3.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils + +DESCRIPTION="A squid redirector to allow easy antivirus file checking" +HOMEPAGE="http://www.samse.fr/GPL/" +SRC_URI="http://www.samse.fr/GPL/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +IUSE="" + +DEPEND=">=net-misc/curl-7.12.1 + virtual/libc + dev-libs/openssl + sys-libs/zlib + app-arch/bzip2 + dev-libs/gmp" +RDEPEND="${DEPEND} + net-proxy/squid" + +S="${WORKDIR}/${PN}" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/${P}-makefile.patch" + epatch "${FILESDIR}/${P}-log.patch" + epatch "${FILESDIR}/${P}-path.patch" + epatch "${FILESDIR}/${P}-conf.patch" +} + +src_install() { + dosbin squidclamav + insinto /etc + newins squidclamav.conf.dist squidclamav.conf + keepdir /var/log/squidclamav + fowners squid:squid /var/log/squidclamav + dodoc Changelog README squidclamav.conf.dist clwarn.cgi* +} + +pkg_postinst() { + einfo "Add following lines to your squid.conf" + einfo "${HILITE} redirect_program /usr/sbin/squidclamav ${NORMAL}" + einfo "${HILITE} redirect_children 15 ${NORMAL} #adjust to your needs" + einfo "and this line to your acl list to prevent loops:" + einfo "${HILITE} redirector_access deny localhost ${NORMAL}" +} |