ports/84137: update mail/p3scan from 1.0.2 to 2.1
dawnshade
h-k at mail.ru
Tue Jul 26 19:00:33 UTC 2005
>Number: 84137
>Category: ports
>Synopsis: update mail/p3scan from 1.0.2 to 2.1
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Jul 26 19:00:31 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: dawnshade
>Release: 5.3-RELEASE
>Organization:
-
>Environment:
FreeBSD mail1.*.ru 5.3-RELEASE-p5 FreeBSD 5.3-RELEASE-p5 #1: Wed Feb 9 11:11:04 MSK 2005 root@:/usr/src/sys/i386/compile/2 i386
>Description:
update mail/p3scan from 1.0.2 to 2.1
>How-To-Repeat:
install p3scan from ports. downloaded from sources doesn't compile. some patches to work.
>Fix:
/usr/ports/mail > diff -ruN p3scan p3scan.new
diff -ruN p3scan/Makefile p3scan.new/Makefile
--- p3scan/Makefile Wed Dec 8 13:29:37 2004
+++ p3scan.new/Makefile Tue Jul 26 22:41:04 2005
@@ -6,8 +6,8 @@
#
PORTNAME= p3scan
-PORTVERSION= 1.0
-PORTREVISION= 2
+PORTVERSION= 2.1
+PORTREVISION= 0
CATEGORIES= mail net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -38,7 +38,7 @@
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/p3scan ${PREFIX}/sbin/
${INSTALL_DATA} ${WRKSRC}/p3scan.conf ${PREFIX}/etc/p3scan.conf.sample
- ${INSTALL_DATA} ${WRKSRC}/p3scan.mail ${PREFIX}/etc/p3scan.mail.sample
+ ${INSTALL_DATA} ${WRKSRC}/p3scan-en.mail ${PREFIX}/etc/p3scan.mail.sample
${INSTALL_SCRIPT} ${FILESDIR}/p3scan.sh ${PREFIX}/etc/rc.d/
.for f in ${MAN8}
${INSTALL_MAN} ${WRKSRC}/${f}.gz ${MAN8PREFIX}/man/man8/
diff -ruN p3scan/distinfo p3scan.new/distinfo
--- p3scan/distinfo Wed Feb 18 05:00:30 2004
+++ p3scan.new/distinfo Tue Jul 26 22:41:04 2005
@@ -1,2 +1,2 @@
-MD5 (p3scan-1.0.tar.gz) = d5d354f85727667e781bc5e05e4ffb4d
-SIZE (p3scan-1.0.tar.gz) = 180274
+MD5 (p3scan-2.1.tar.gz) = 5e261548e522f3ac2583870b6e02aecd
+SIZE (p3scan-2.1.tar.gz) = 348717
diff -ruN p3scan/files/patch-Makefile p3scan.new/files/patch-Makefile
--- p3scan/files/patch-Makefile Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-Makefile Tue Jul 26 22:41:04 2005
@@ -1,25 +1,34 @@
---- Makefile.orig Wed Jan 21 11:33:02 2004
-+++ Makefile Wed Feb 18 10:43:15 2004
-@@ -26,12 +26,12 @@
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
--PREFIX=/usr
--MANDIR=$(PREFIX)/man/man8
+--- Makefile.orig Tue Jul 26 13:25:59 2005
++++ Makefile Tue Jul 26 15:00:51 2005
+@@ -34,20 +34,20 @@
+ LOGFAC="LOG_DAEMON"
+ LOGSET=-DLOGOPT=${LOGOPT} -DLOGFAC=${LOGFAC}
+ LANG=en
-CC=gcc
--#CFLAGS=-Wall -ggdb
--CFLAGS=-Wall -O2
++CC?=gcc
+ SYSINS=ginstall
+-CFLAGS=-Wall -O2 ${LOGSET}
-LDFLAGS=-L. -lripmime -lpcre #-static
-+PREFIX?= /usr
-+MANDIR?= $(PREFIX)/man/man8
-+CC?= gcc
-+#CFLAGS= -Wall -ggdb
-+CFLAGS+= -Wall -O2 -I${PREFIX}/include
-+LDFLAGS+= -L. -lripmime -lpcre ${_LDFLAGS}
++CFLAGS+=-Wall -O2 ${LOGSET} -I${PREFIX}/include -I/usr/local/include
++LDFLAGS+=-L. -lripmime -lpcre ${_LDFLAGS} #-static
+
+ PREFIX=/usr
+ #MANDIR=$(PREFIX)/share/man/man8
+-MANDIR=$(PREFIX)/man/man8
++MANDIR?=$(PREFIX)/man/man8
+ piddir=/var/run/$(PROGS)
+ datadir=/var/spool/$(PROGS)
+ notify=/var/spool/$(PROGS)/notify
+-user=mail.mail
+-userdir=/etc/$(PROGS)
+-docdir=/usr/doc/$(DISTNAME)
++user=mail:mail
++userdir=/usr/local/etc/$(PROGS)
++docdir=/usr/local/doc/$(DISTNAME)
+ # End user options
OBJECTS=getline.o parsefile.o p3scan.o \
- scanner_basic.o scanner_avpd.o scanner_trophie.o
-@@ -62,8 +62,8 @@
+@@ -71,8 +71,8 @@
dep depend .dep:
@echo "creating depencies"
@@ -28,9 +37,9 @@
+ rm -f .tmp.dep
+ @find . -name "*.c" -maxdepth 1 -print0 | xargs -n 1 -0t $(CC) -M $(CFLAGS) >>.tmp.dep
mv .tmp.dep .dep
-
+
install: p3scan
-@@ -143,9 +143,9 @@
+@@ -148,9 +148,9 @@
fulltags:
@#VIM Users know why! *g*
diff -ruN p3scan/files/patch-getline.c p3scan.new/files/patch-getline.c
--- p3scan/files/patch-getline.c Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-getline.c Tue Jul 26 22:41:04 2005
@@ -1,11 +1,15 @@
---- getline.c.orig Tue Feb 17 21:58:12 2004
-+++ getline.c Tue Feb 17 21:58:17 2004
-@@ -30,7 +30,7 @@
+--- getline.c.orig Tue Jul 26 13:29:05 2005
++++ getline.c Tue Jul 26 11:10:51 2005
+@@ -33,11 +33,11 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
-#include <malloc.h>
-+#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <sys/time.h>
+ #include <errno.h>
++#include <stdlib.h>
+
+ #include "getline.h"
+
diff -ruN p3scan/files/patch-p3scan.c p3scan.new/files/patch-p3scan.c
--- p3scan/files/patch-p3scan.c Wed Feb 18 05:42:35 2004
+++ p3scan.new/files/patch-p3scan.c Tue Jul 26 22:41:04 2005
@@ -1,9 +1,9 @@
---- p3scan.c.orig Wed Jan 21 01:26:48 2004
-+++ p3scan.c Wed Feb 18 13:32:33 2004
-@@ -30,34 +30,39 @@
- *
- */
-
+--- p3scan.c.orig Tue Jul 26 15:39:29 2005
++++ p3scan.c Tue Jul 26 15:38:58 2005
+@@ -36,36 +36,37 @@
+ TODO: Wanted: white-list support
+ TODO: Wanted: no iptables support
+ */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
@@ -43,17 +43,16 @@
#include <libgen.h>
#include <errno.h>
#include <dirent.h>
-+#ifdef __FreeBSD__
+-#include <sys/statvfs.h>
+ #include <assert.h>
+ #include <sys/select.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
-+#else
-+#include <linux/netfilter_ipv4.h>
- #include <sys/statvfs.h>
-+#endif
++
#include "p3scan.h"
#include "getline.h"
-@@ -81,8 +86,8 @@
+@@ -94,13 +95,13 @@
#define VIRUS_SCANNER_VIRUSCODE 1
#define PID_FILE "/var/run/p3scan/p3scan.pid"
#define SYSLOG_NAME "p3scan"
@@ -63,18 +62,22 @@
+#define VIRUS_TEMPLATE "/usr/local/etc/p3scan/p3scan.mail"
#define DEBUG 0
#define QUIET 0
- #define OVERWRITE 0
-@@ -340,11 +345,24 @@
- #define MOVEIT "/bin/mv"
+ #define OVERWRITE NULL
+ #define CHECKSPAM 0
+-#define SPAMCHECK "/usr/bin/spamc"
++#define SPAMCHECK "/usr/local/bin/spamc"
+ #define MINSPACE 0
+ #define DELIT 0
+ #define NEWLINE '\n'
+@@ -507,10 +508,21 @@
FILE * scanner;
static char line[4096*16];
+ //static char line[4096];
- struct statvfs fs;
- int kbfree;
- struct linebuf *filebuf;
- int res, htmlfd, html, toggle;
+ unsigned long kbfree;
+ int htmlfd;
-+#ifdef __FreeBSD__
-+ struct statfs fs;
++ struct statfs fs;
+ if ((ret=statfs(config->virusdir,&fs))!=0) {
+ do_log(LOG_EMERG, "Unable to get available space!");
+ return SCANNER_RET_CRIT; // Should never reach here, but keep it clean. :)
@@ -84,32 +87,34 @@
+ do_log(LOG_CRIT, "Not enough space! Available space: %d", kbfree);
+ return SCANNER_RET_CRIT;
+ }
-+#else
-+ struct statvfs fs;
+
- /* See if we have enough room to process the message based upon
- what the user determines is enough room in p3scan.conf */
- if ( statvfs( config->virusdir, &fs ) == SCANNER_RET_ERR){
-@@ -356,6 +374,7 @@
- do_log(LOG_CRIT, "Not enough space! Available space: %d", kbfree);
- return SCANNER_RET_CRIT;
++
+ ret=checktimeout(p);
+ if (ret < 0) return SCANNER_RET_CRIT;
+ /* See if we have enough room to process the message based upon
+@@ -521,7 +533,7 @@
+ do_log(LOG_EMERG, "Unable to get available space!");
+ return SCANNER_RET_CRIT; // Should never reach here, but keep it clean. :)
}
-+#endif
-
- /* This is where we should scan for spam - before demime to
- give SpamAssassin the virgin message */
-@@ -820,8 +839,8 @@
- do_log(LOG_NOTICE, "Connection from %s:%i", inet_ntoa(p->client_addr.sin_addr), ntohs(p->client_addr.sin_port));
+- kbfree=(fs.f_bavail * fs.f_frsize / 1024);
++ kbfree=(fs.f_bavail * fs.f_bsize / 1024);
+ if ( config->freespace != 0 && kbfree < config->freespace ){
+ p->errmsg=1;
+ do_log(LOG_CRIT, "Not enough space! Available space: %d", kbfree);
+@@ -1179,8 +1191,10 @@
p->server_addr.sin_family = AF_INET;
-- if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
-- do_log(LOG_CRIT, "No IP-Conntrack-data (getsockopt failed)");
+ if (htonl(INADDR_ANY) == config->targetaddr.sin_addr.s_addr) {
+- if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
+- do_log(LOG_CRIT, "No IP-Conntrack-data (getsockopt failed)");
++// if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
++// do_log(LOG_CRIT, "No IP-Conntrack-data (getsockopt failed)");
+ if (getsockname(p->client_fd, (struct sockaddr*)&p->server_addr, &p->socksize)){
+ do_log(LOG_CRIT, "No IP-Conntrack-data (getsockname failed)");
- return 1;
- }
- do_log(LOG_NOTICE, "Real-server adress is %s:%i", inet_ntoa(p->server_addr.sin_addr), ntohs(p->server_addr.sin_port));
-@@ -1534,7 +1553,7 @@
+ return 1;
+ }
+ /* try to avoid loop */
+@@ -2041,7 +2055,7 @@
char * responsemsg;
int virusdirlen;
char chownit[100];
@@ -118,14 +123,15 @@
int len;
int ret;
FILE * chowncmd;
-@@ -1574,8 +1593,8 @@
- };
- // chown /var/run/p3scan/p3scan.pid mail.mail
- len=strlen(CHOWNCMD)+1+strlen(config->runasuser)+1+strlen(config->runasuser)+1+strlen(config->pidfile)+1;
-- do_log(LOG_DEBUG, "%s %s.%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
-- snprintf(chownit, len, "%s %s.%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
-+ do_log(LOG_DEBUG, "%s %s:%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
-+ snprintf(chownit, len, "%s %s:%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
- if ((chowncmd=popen(chownit, "r"))==NULL){
- do_log(LOG_ALERT, "Can't '%s' !!!", chowncmd);
- return SCANNER_RET_ERR;
+@@ -2080,7 +2094,10 @@
+ if (!config->debug){
+ len=strlen(CHOWNCMD)+1+strlen(config->runasuser)+1+strlen(config->runasuser)+1+strlen(config->pidfile)+1;
+ //do_log(LOG_DEBUG, "%s %s.%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
+- snprintf(chownit, len, "%s %s.%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
++// snprintf(chownit, len, "%s %s.%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
++ do_log(LOG_DEBUG, "%s %s:%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
++ snprintf(chownit, len, "%s %s:%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
++
+ if ((chowncmd=popen(chownit, "r"))==NULL){
+ do_log(LOG_ALERT, "Can't '%s' !!!", chowncmd);
+ return SCANNER_RET_ERR;
diff -ruN p3scan/files/patch-parsefile.c p3scan.new/files/patch-parsefile.c
--- p3scan/files/patch-parsefile.c Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-parsefile.c Tue Jul 26 22:41:04 2005
@@ -1,10 +1,16 @@
---- parsefile.c.orig Tue Feb 17 21:58:27 2004
-+++ parsefile.c Tue Feb 17 21:59:39 2004
-@@ -33,7 +33,6 @@
+--- parsefile.c.orig Wed Jan 5 20:53:04 2005
++++ parsefile.c Tue Jul 26 11:10:08 2005
+@@ -33,11 +33,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
-#include <malloc.h>
++#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "parsefile.h"
+ #include "getline.h"
++#include <netinet/in.h>
+
+ #define NONULL(x) ( x==NULL ? "" : x) /* this is nice, found in the mutt code */
+
diff -ruN p3scan/files/patch-ripmime::build_ripOLE p3scan.new/files/patch-ripmime::build_ripOLE
--- p3scan/files/patch-ripmime::build_ripOLE Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-ripmime::build_ripOLE Tue Jul 26 22:41:04 2005
@@ -1,5 +1,5 @@
---- ripmime/build_ripOLE.orig Wed Jul 16 21:18:54 2003
-+++ ripmime/build_ripOLE Wed Feb 18 10:31:19 2004
+--- ripmime/build_ripOLE.orig Wed Jan 5 20:53:04 2005
++++ ripmime/build_ripOLE Tue Jul 26 12:48:42 2005
@@ -1,4 +1,4 @@
#!/bin/sh
cd ripOLE
diff -ruN p3scan/files/patch-ripmime::build_tnef p3scan.new/files/patch-ripmime::build_tnef
--- p3scan/files/patch-ripmime::build_tnef Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-ripmime::build_tnef Tue Jul 26 22:41:04 2005
@@ -1,5 +1,5 @@
---- ripmime/build_tnef.orig Sat Nov 15 20:39:05 2003
-+++ ripmime/build_tnef Wed Feb 18 10:31:43 2004
+--- ripmime/build_tnef.orig Wed Jan 5 20:53:04 2005
++++ ripmime/build_tnef Tue Jul 26 12:48:14 2005
@@ -1,3 +1,3 @@
#!/bin/sh
cd tnef
diff -ruN p3scan/files/patch-ripmime::tnef::Makefile p3scan.new/files/patch-ripmime::tnef::Makefile
--- p3scan/files/patch-ripmime::tnef::Makefile Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-ripmime::tnef::Makefile Tue Jul 26 22:41:04 2005
@@ -1,19 +1,13 @@
---- ripmime/tnef/Makefile.orig Sat Nov 15 20:39:06 2003
-+++ ripmime/tnef/Makefile Wed Feb 18 11:03:29 2004
-@@ -1,13 +1,13 @@
-
--CC=cc
-+CC?=cc
-
- # Possible platforms are SUN, HPUX, DEC, SGI, AIX, Linux and MSDOS
+--- ripmime/tnef/Makefile.orig Tue Jul 26 14:31:25 2005
++++ ripmime/tnef/Makefile Tue Jul 26 14:32:30 2005
+@@ -4,8 +4,8 @@
# The main definitions are for 32/16 bits and for byte order, the
# default is big endian. You can do -D__TNEF_BYTE_ORDER 1234 for little
# endian
-PLATFORM=-D___TNEF_BYTE_ORDER=4321
+-CFLAGS=-Wall -g -O2 -I.
+PLATFORM=-D___TNEF_BYTE_ORDER=_BYTE_ORDER -include /usr/include/machine/endian.h
- #CFLAGS = -O2 -ggdb
--CFLAGS = -Wall -g -I..
-+CFLAGS += -Wall -g -I..
-
++CFLAGS+=-Wall -g -O2 -I.
default: config.h tnef.h tnef.c
+ $(CC) $(CFLAGS) $(PLATFORM) -c tnef.c
diff -ruN p3scan/files/patch-scanner_avpd.c p3scan.new/files/patch-scanner_avpd.c
--- p3scan/files/patch-scanner_avpd.c Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-scanner_avpd.c Tue Jul 26 22:41:04 2005
@@ -1,5 +1,5 @@
---- scanner_avpd.c.orig Thu Dec 4 02:58:25 2003
-+++ scanner_avpd.c Wed Feb 18 12:50:42 2004
+--- scanner_avpd.c.orig Wed Jan 5 20:53:04 2005
++++ scanner_avpd.c Tue Jul 26 12:44:34 2005
@@ -39,12 +39,12 @@
#include <time.h>
#include <sys/time.h>
@@ -11,15 +11,5 @@
#include <dirent.h>
#include <ctype.h>
+#include <netinet/in.h>
-
+
#include "p3scan.h"
-
-@@ -81,7 +81,7 @@
- if (avp_fd!=-1 && connected==-1){
- do_log(LOG_DEBUG, "Trying to connect to socket");
- if (connect(avp_fd, (struct sockaddr *)(&avp_socket),
-- sizeof(avp_socket.sun_family) + strlen(NodeCtl)) >= 0){
-+ SUN_LEN(&avp_socket)) >= 0){
- connected=1;
- do_log(LOG_DEBUG, "avp_socket_connect connected to kavdaemon");
- return 0;
diff -ruN p3scan/files/patch-scanner_basic.c p3scan.new/files/patch-scanner_basic.c
--- p3scan/files/patch-scanner_basic.c Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-scanner_basic.c Thu Jan 1 03:00:00 1970
@@ -1,13 +0,0 @@
---- scanner_basic.c.orig Tue Feb 17 21:58:49 2004
-+++ scanner_basic.c Tue Feb 17 22:20:28 2004
-@@ -34,8 +34,9 @@
- #include <string.h>
- #include <sys/wait.h>
- #include <sys/stat.h>
-+#include <netinet/in.h>
- #include <errno.h>
--#include <malloc.h>
-+#include <stdlib.h>
- #include <pcre.h>
-
- #include "p3scan.h"
diff -ruN p3scan/files/patch-scanner_sample.c p3scan.new/files/patch-scanner_sample.c
--- p3scan/files/patch-scanner_sample.c Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-scanner_sample.c Tue Jul 26 22:41:04 2005
@@ -1,11 +1,14 @@
---- scanner_sample.c.orig Tue Feb 17 21:58:55 2004
-+++ scanner_sample.c Tue Feb 17 21:59:01 2004
-@@ -31,7 +31,7 @@
+--- scanner_sample.c.orig Wed Jan 5 20:53:04 2005
++++ scanner_sample.c Tue Jul 26 11:11:27 2005
+@@ -31,10 +31,9 @@
*/
-
+
#include <stdio.h>
-#include <malloc.h>
-+#include <stdlib.h>
#include <sys/un.h>
#include <sys/socket.h>
-
+-
++#include <stdlib.h>
+
+ /* we need p3scan.h */
+ #include "p3scan.h"
diff -ruN p3scan/files/patch-scanner_trophie.c p3scan.new/files/patch-scanner_trophie.c
--- p3scan/files/patch-scanner_trophie.c Wed Feb 18 05:00:30 2004
+++ p3scan.new/files/patch-scanner_trophie.c Tue Jul 26 22:41:04 2005
@@ -1,5 +1,5 @@
---- scanner_trophie.c.orig Thu Dec 4 02:57:56 2003
-+++ scanner_trophie.c Wed Feb 18 12:51:22 2004
+--- scanner_trophie.c.orig Wed Jan 5 20:53:04 2005
++++ scanner_trophie.c Tue Jul 26 12:44:51 2005
@@ -37,11 +37,11 @@
#include <sys/wait.h>
#include <sys/stat.h>
@@ -10,15 +10,5 @@
#include <stdarg.h>
#include <ctype.h>
+#include <netinet/in.h>
-
+
#include "p3scan.h"
-
-@@ -68,7 +68,7 @@
- if (trophie_fd!=-1 && connected==-1){
- do_log(LOG_DEBUG, "Trying to connect to socket");
- if (connect(trophie_fd, (struct sockaddr *)(&trophie_socket),
-- sizeof(trophie_socket.sun_family) + strlen(config->virusscanner)) >= 0){
-+ SUN_LEN(&trophie_socket)) >= 0){
- connected=1;
- do_log(LOG_DEBUG, "trophie_socket_connect connected");
- return 0;
diff -ruN p3scan/pkg-message p3scan.new/pkg-message
--- p3scan/pkg-message Wed Feb 18 05:59:37 2004
+++ p3scan.new/pkg-message Tue Jul 26 22:41:04 2005
@@ -16,4 +16,8 @@
while 192.168.0.254 is the IP of your internal interface, 8110 is the
default port of P3scan, and 192.168.0.0/24 is the IP range of your LAN.
+
+Don't forget chown -R <clamavuser> /var/run/p3scan /var/spool/p3scan
+<clamavuser> must be same as in running clamd.
+
**********************************************************************
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list