View | Details | Raw Unified | Return to bug 96673
Collapse All | Expand All

(-)p3scan/MakefileTue May 2 22:33:54 2006 (-4 / +11 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=p3scan
8
PORTNAME=p3scan
9
PORTVERSION=2.1
9
PORTVERSION=2.3.2
10
CATEGORIES=mail net
10
CATEGORIES=mail net
11
MASTER_SITES=${MASTER_SITE_SOURCEFORGE}
11
MASTER_SITES=${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITE_SUBDIR=${PORTNAME}
12
MASTER_SITE_SUBDIR=${PORTNAME}
Lines 23-29 Link Here
23
SUB_FILES=pkg-message
23
SUB_FILES=pkg-message
24
PKGMESSAGE=${WRKDIR}/pkg-message
24
PKGMESSAGE=${WRKDIR}/pkg-message
25
25
26
OPTIONS=UVSCAN "Use UVSCAN" on
26
OPTIONS=UVSCAN "Use UVSCAN" off
27
27
28
PORTDOCS=AUTHORS CHANGELOG LICENSE NEWS README
28
PORTDOCS=AUTHORS CHANGELOG LICENSE NEWS README
29
29
Lines 37-45 Link Here
37
.endif
37
.endif
38
38
39
do-install:
39
do-install:
40
.if !exists(${PREFIX}/etc/p3scan)
41
${MKDIR} ${PREFIX}/etc/p3scan
42
.endif
43
.if !exists(/var/spool/p3scan)
44
${MKDIR} /var/spool/p3scan
45
.endif
46
${CHOWN} mailnull:mail /var/spool/p3scan
40
${INSTALL_PROGRAM} ${WRKSRC}/p3scan ${PREFIX}/sbin/
47
${INSTALL_PROGRAM} ${WRKSRC}/p3scan ${PREFIX}/sbin/
41
${INSTALL_DATA} ${WRKSRC}/p3scan.conf ${PREFIX}/etc/p3scan.conf.sample
48
${INSTALL_DATA} ${WRKSRC}/p3scan.conf ${PREFIX}/etc/p3scan/p3scan.conf.sample
42
${INSTALL_DATA} ${WRKSRC}/p3scan-en.mail ${PREFIX}/etc/p3scan.mail.sample
49
${INSTALL_DATA} ${WRKSRC}/p3scan-en.mail ${PREFIX}/etc/p3scan/p3scan.mail.sample
43
${INSTALL_SCRIPT} ${FILESDIR}/p3scan.sh ${PREFIX}/etc/rc.d/
50
${INSTALL_SCRIPT} ${FILESDIR}/p3scan.sh ${PREFIX}/etc/rc.d/
44
.for f in ${MAN8}
51
.for f in ${MAN8}
45
${INSTALL_MAN} ${WRKSRC}/${f}.gz ${MAN8PREFIX}/man/man8/
52
${INSTALL_MAN} ${WRKSRC}/${f}.gz ${MAN8PREFIX}/man/man8/
(-)p3scan/distinfoMon May 1 09:48:22 2006 (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (p3scan-2.1.tar.gz) = 5e261548e522f3ac2583870b6e02aecd
1
MD5 (p3scan-2.3.2.tar.gz) = 9f8decc7d4701228788e3c8717096ca0
2
SHA256 (p3scan-2.1.tar.gz) = 26ebe4034c7016581d808b5de47d2a3288fc25a6bb27be116d2497c9aadcf9e7
2
SHA256 (p3scan-2.3.2.tar.gz) = 570bdf87132b23120339e247809dc2cf37c2735d504f4e1072528c04d940bb5f
3
SIZE (p3scan-2.1.tar.gz) = 348717
3
SIZE (p3scan-2.3.2.tar.gz) = 321684
(-)p3scan/files/p3scan.shTue May 2 22:24:46 2006 (-3 / +1 lines)
Lines 5-17 Link Here
5
    exit 1
5
    exit 1
6
fi
6
fi
7
7
8
user=p3scan
9
configfile=${PREFIX}/etc/p3scan.conf
10
8
11
case "$1" in
9
case "$1" in
12
    start)
10
    start)
13
    echo -n "P3Scan "
11
    echo -n "P3Scan "
14
    ${PREFIX}/sbin/p3scan --configfile=${configfile} || exit 1
12
    ${PREFIX}/sbin/p3scan || exit 1
15
    ;;
13
    ;;
16
    stop)
14
    stop)
17
    echo -n "Shutting down P3Scan"
15
    echo -n "Shutting down P3Scan"
(-)p3scan/files/patch-MakefileMon May 1 11:08:10 2006 (-27 / +32 lines)
Lines 1-53 Link Here
1
--- Makefile.orig      Tue Jul 26 13:25:59 2005
1
--- Makefile.origMon Dec 12 18:00:00 2005
2
+++ Makefile   Tue Jul 26 15:00:51 2005
2
+++ MakefileMon May  1 11:07:46 2006
3
@@ -34,20 +34,20 @@
3
@@ -39,27 +39,27 @@
4
 LOGFAC="LOG_DAEMON"
4
 LOGFAC="LOG_DAEMON"
5
 LOGSET=-DLOGOPT=${LOGOPT} -DLOGFAC=${LOGFAC}
5
 LOGSET=-DLOGOPT=${LOGOPT} -DLOGFAC=${LOGFAC}
6
 LANG=en
6
 LANG=en
7
-CC=gcc
7
-CC=gcc
8
+CC?=gcc
8
+CC?=gcc
9
 SYSINS=ginstall
9
 SYSINS=install
10
-CFLAGS=-Wall -O2 ${LOGSET}
10
 #CFLAGS=-Wall -O3 -march=i686 ${LOGSET}
11
-LDFLAGS=-L. -lripmime -lpcre #-static
11
-CFLAGS=-Wall -O2 $(LOGSET)
12
+CFLAGS+=-Wall -O2 ${LOGSET} -I${PREFIX}/include -I/usr/local/include
12
+CFLAGS=-Wall -O2 $(LOGSET) -I${PREFIX}/include -I/usr/local/include
13
+LDFLAGS+=-L. -lripmime -lpcre ${_LDFLAGS} #-static
14
 
13
 
15
 PREFIX=/usr
14
 #ifdef DEMIME :)
15
-LDFLAGS=-L. -lripmime -lpcre -lssl -lcrypto #-static
16
+LDFLAGS=-L. -lripmime -lpcre -lssl -lcrypto ${_LDFLAGS} #-static
17
 #else
18
 #LDFLAGS=-L. -lpcre -lssl -lcrypto
19
 #endif :)
20
 
21
-PREFIX=/usr
22
+PREFIX=/usr/local
23
 DESTDIR=
16
 #MANDIR=$(PREFIX)/share/man/man8
24
 #MANDIR=$(PREFIX)/share/man/man8
17
-MANDIR=$(PREFIX)/man/man8
25
-MANDIR=$(PREFIX)/man/man8
18
+MANDIR?=$(PREFIX)/man/man8
26
+MANDIR?=$(PREFIX)/man/man8
19
 piddir=/var/run/$(PROGS)
27
 piddir=/var/run/$(PROGS)
20
 datadir=/var/spool/$(PROGS)
28
 datadir=/var/spool/$(PROGS)
21
 notify=/var/spool/$(PROGS)/notify
29
 notify=/var/spool/$(PROGS)/notify
22
-user=mail.mail
23
-userdir=/etc/$(PROGS)
30
-userdir=/etc/$(PROGS)
24
-docdir=/usr/doc/$(DISTNAME)
31
-docdir=/usr/doc/$(DISTNAME)
25
+user=mail:mail
32
-user=mail:mail
26
+userdir=/usr/local/etc/$(PROGS)
33
+userdir=$(PREFIX)/etc/$(PROGS)
27
+docdir=/usr/local/doc/$(DISTNAME)
34
+docdir=$(PREFIX)/share/doc/$(DISTNAME)
35
+user=mailnull:mail
28
 # End user options
36
 # End user options
29
 
37
 
30
 OBJECTS=getline.o parsefile.o p3scan.o \
38
 OBJECTS=getlinep3.o getline_ssl.o parsefile.o p3scan.o \
31
@@ -71,8 +71,8 @@
39
@@ -85,7 +85,7 @@
32
 
33
 dep depend .dep:
40
 dep depend .dep:
34
 @echo "creating depencies"
41
 @echo "creating depencies"
35
-rm .tmp.dep -f
42
 rm -f .tmp.dep
36
-@find -name "*.c"   -maxdepth 1 -print0 | xargs -n 1 -0rt $(CC) -M $(CFLAGS)  >>.tmp.dep
43
-@find -maxdepth 1 -name "*.c" -print0 | xargs -n 1 -0rt $(CC) -M $(CFLAGS)  >>.tmp.dep
37
+rm -f .tmp.dep
44
+@find . -maxdepth 1 -name "*.c" -print0 | xargs -n 1 -0rt $(CC) -M $(CFLAGS)  >>.tmp.dep
38
+@find . -name "*.c"   -maxdepth 1 -print0 | xargs -n 1 -0t $(CC) -M $(CFLAGS)  >>.tmp.dep
39
 mv .tmp.dep .dep
45
 mv .tmp.dep .dep
40
 
46
 
41
 install: p3scan
47
 install: p3scan
42
@@ -148,9 +148,9 @@
48
@@ -163,8 +163,8 @@
43
 
49
 
44
 fulltags:
50
 fulltags:
45
 @#VIM Users know why! *g*
51
 @#VIM Users know why! *g*
46
-find -name "*.c" -maxdepth 1 -print0 \
52
-find -maxdepth 1 -name "*.c" -print0 | xargs -n 1 -0r $(CC) -M -H $(CFLAGS) 2>.totag >/dev/null
47
+find . -name "*.c" -maxdepth 1 -print0 \
53
-find -maxdepth 1 -name "*.c" -print0 | xargs -n 1 -0r echo >>.totag
48
 | xargs -n 1 -0r $(CC) -M -H $(CFLAGS) 2>.totag >/dev/null
54
+find . -maxdepth 1 -name "*.c" -print0 | xargs -n 1 -0r $(CC) -M -H $(CFLAGS) 2>.totag >/dev/null
49
-find -name "*.c" -maxdepth 1 -print0 \
55
+find . -maxdepth 1 -name "*.c" -print0 | xargs -n 1 -0r echo >>.totag
50
+find . -name "*.c" -maxdepth 1 -print0 \
51
 | xargs -n 1 -0r echo >>.totag
52
 cat .totag | sed "s/^[[:space:]]*//" | grep -v "^$(CC)" | sort | uniq >.totag
56
 cat .totag | sed "s/^[[:space:]]*//" | grep -v "^$(CC)" | sort | uniq >.totag
53
 ctags --c-types=+c+p+f+x -L .totag .
57
 ctags --c-types=+c+p+f+x -L .totag .
58
 rm -f .totag
(-)p3scan/files/patch-getline.cThu Jan 1 03:00:00 1970 (-15 lines)
Lines 1-15 Link Here
1
--- getline.c.orig     Tue Jul 26 13:29:05 2005
2
+++ getline.c  Tue Jul 26 11:10:51 2005
3
@@ -33,11 +33,11 @@
4
 #include <stdio.h>
5
 #include <unistd.h>
6
 #include <string.h>
7
-#include <malloc.h>
8
 #include <stdarg.h>
9
 #include <fcntl.h>
10
 #include <sys/time.h>
11
 #include <errno.h>
12
+#include <stdlib.h>
13
 
14
 #include "getline.h"
15
 
(-)p3scan/files/patch-getline_ssl.cMon May 1 09:48:22 2006 (+18 lines)
Line 0 Link Here
1
--- getline_ssl.c.origMon May  1 00:18:22 2006
2
+++ getline_ssl.cMon May  1 00:18:25 2006
3
@@ -38,7 +38,6 @@
4
 #include <stdio.h>
5
 #include <unistd.h>
6
 #include <string.h>
7
-#include <malloc.h>
8
 #include <stdarg.h>
9
 #include <fcntl.h>
10
 #include <sys/time.h>
11
@@ -50,6 +49,7 @@
12
 #include <netdb.h>
13
 #include <stdlib.h>
14
 #include <sys/wait.h>
15
+#include <stdlib.h>
16
 
17
 #include "getline_ssl.h"
18
 
(-)p3scan/files/patch-getlinep3.cMon May 1 09:48:22 2006 (+11 lines)
Line 0 Link Here
1
--- getlinep3.c.origMon May  1 00:39:10 2006
2
+++ getlinep3.cMon May  1 00:39:28 2006
3
@@ -37,7 +37,7 @@
4
 #include <stdio.h>
5
 #include <unistd.h>
6
 #include <string.h>
7
-#include <malloc.h>
8
+#include <stdlib.h>
9
 #include <stdarg.h>
10
 #include <fcntl.h>
11
 #include <sys/time.h>
(-)p3scan/files/patch-p3scan.cMon May 1 09:48:22 2006 (-80 / +27 lines)
Lines 1-6 Link Here
1
--- p3scan.c.origThu Jan  6 04:53:04 2005
1
--- p3scan.c.origMon Dec 12 18:00:00 2005
2
+++ p3scan.cFri Jul 29 10:10:15 2005
2
+++ p3scan.cMon May  1 00:45:41 2006
3
@@ -36,36 +36,38 @@
3
@@ -41,36 +41,37 @@
4
 TODO: Wanted: white-list support
4
 TODO: Wanted: white-list support
5
 TODO: Wanted: no iptables support
5
 TODO: Wanted: no iptables support
6
 */
6
 */
Lines 49-138 Link Here
49
 #include <sys/select.h>
49
 #include <sys/select.h>
50
+#include <sys/ucred.h>
50
+#include <sys/ucred.h>
51
+#include <sys/mount.h>
51
+#include <sys/mount.h>
52
+
53
 
52
 
54
 #include "p3scan.h"
53
 #include "p3scan.h"
55
 #include "getline.h"
54
 #include "getline_ssl.h"
56
@@ -94,13 +96,13 @@
55
@@ -1640,8 +1641,9 @@
57
 #define VIRUS_SCANNER_VIRUSCODE  1
58
 #define PID_FILE                 "/var/run/p3scan/p3scan.pid"
59
 #define SYSLOG_NAME              "p3scan"
60
-#define CONFIGFILE               "/etc/p3scan/p3scan.conf"
61
-#define VIRUS_TEMPLATE           "/etc/p3scan/p3scan.mail"
62
+#define CONFIGFILE               "/usr/local/etc/p3scan/p3scan.conf"
63
+#define VIRUS_TEMPLATE           "/usr/local/etc/p3scan/p3scan.mail"
64
 #define DEBUG                    0
65
 #define QUIET                    0
66
 #define OVERWRITE                NULL
67
 #define CHECKSPAM                0
68
-#define SPAMCHECK                "/usr/bin/spamc"
69
+#define SPAMCHECK                "/usr/local/bin/spamc"
70
 #define MINSPACE                 0
71
 #define DELIT                    0
72
 #define NEWLINE                  '\n'
73
@@ -507,10 +509,21 @@
74
    FILE * scanner;
75
    static char  line[4096*16];
76
    //static char  line[4096];
77
-   struct statvfs fs;
78
    unsigned long kbfree;
79
    int htmlfd;
80
 
81
+   struct statfs fs;
82
+    if ((ret=statfs(config->virusdir,&fs))!=0) {
83
+      do_log(LOG_EMERG, "Unable to get available space!");
84
+      return SCANNER_RET_CRIT; // Should never reach here, but keep it clean. :)
85
+    }
86
+    kbfree=fs.f_bavail*fs.f_bsize/1024;
87
+    if ( config->freespace != 0 && kbfree < config->freespace ){
88
+      do_log(LOG_CRIT, "Not enough space! Available space: %d", kbfree);
89
+      return SCANNER_RET_CRIT;
90
+    }
91
+
92
+
93
    ret=checktimeout(p);
94
    if (ret < 0) return SCANNER_RET_CRIT;
95
    /* See if we have enough room to process the message based upon
96
@@ -521,7 +534,7 @@
97
       do_log(LOG_EMERG, "Unable to get available space!");
98
       return SCANNER_RET_CRIT; // Should never reach here, but keep it clean. :)
99
    }
100
-   kbfree=(fs.f_bavail * fs.f_frsize / 1024);
101
+   kbfree=(fs.f_bavail * fs.f_bsize / 1024);
102
    if ( config->freespace != 0 && kbfree < config->freespace ){
103
       p->errmsg=1;
104
       do_log(LOG_CRIT, "Not enough space! Available space: %d", kbfree);
105
@@ -1179,8 +1192,10 @@
106
 
107
    p->server_addr.sin_family = AF_INET;
108
    if (htonl(INADDR_ANY) == config->targetaddr.sin_addr.s_addr) {
109
-      if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
110
-         do_log(LOG_CRIT, "No IP-Conntrack-data (getsockopt failed)");
111
+//      if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
112
+//         do_log(LOG_CRIT, "No IP-Conntrack-data (getsockopt failed)");
113
+   if (getsockname(p->client_fd, (struct sockaddr*)&p->server_addr, &p->socksize)){
114
+      do_log(LOG_CRIT, "No IP-Conntrack-data (getsockname failed)");
115
          return 1;
116
       }
56
       }
117
       /* try to avoid loop */
57
    } else {
118
@@ -2041,7 +2056,7 @@
58
       if (htonl(INADDR_ANY) == config->targetaddr.sin_addr.s_addr) {
59
-         if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
60
-            do_log(LOG_CRIT, "ERR: No IP-Conntrack-data (getsockopt failed)");
61
+         // if (getsockopt(p->client_fd, SOL_IP, SO_ORIGINAL_DST, &p->server_addr, &p->socksize)){
62
+         //   do_log(LOG_CRIT, "ERR: No IP-Conntrack-data (getsockopt failed)");
63
+    if (getsockname(p->client_fd, (struct sockaddr*)&p->server_addr, &p->socksize)){
64
             return 1;
65
          }
66
          /* try to avoid loop */
67
@@ -2882,7 +2884,7 @@
119
    char * responsemsg;
68
    char * responsemsg;
120
    int virusdirlen;
69
    int virusdirlen=0;
121
    char chownit[100];
70
    char chownit[100];
122
-#define CHOWNCMD "/bin/chown"
71
-#define CHOWNCMD "/bin/chown"
123
+#define CHOWNCMD "/usr/sbin/chown"
72
+#define CHOWNCMD "/usr/sbin/chown"
124
    int len;
73
    int len=0;
125
    int ret;
74
    int ret=0;
126
    FILE * chowncmd;
75
    FILE * chowncmd;
127
@@ -2080,7 +2095,10 @@
76
@@ -2920,7 +2922,8 @@
128
       if (!config->debug){
77
       fclose(fp);
129
          len=strlen(CHOWNCMD)+1+strlen(config->runasuser)+1+strlen(config->runasuser)+1+strlen(config->pidfile)+1;
78
    }else do_log(LOG_CRIT, "ERR: Can't write PID to %s", PID_FILE);
130
          //do_log(LOG_DEBUG, "%s %s.%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
79
    len=strlen(CHOWNCMD)+1+strlen(config->runasuser)+1+strlen(config->runasuser)+1+strlen(config->pidfile)+1;
131
-         snprintf(chownit, len, "%s %s.%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
80
-   snprintf(chownit, len, "%s %s:%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
132
+//         snprintf(chownit, len, "%s %s.%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
133
+         do_log(LOG_DEBUG, "%s %s:%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
81
+         do_log(LOG_DEBUG, "%s %s:%s %s=%i",CHOWNCMD, config->runasuser, config->runasuser, config->pidfile, len);
134
+         snprintf(chownit, len, "%s %s:%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
82
+         snprintf(chownit, len, "%s %s:%s %s", CHOWNCMD, config->runasuser, config->runasuser, config->pidfile);
135
+
83
    if ((chowncmd=popen(chownit, "r"))==NULL){
136
          if ((chowncmd=popen(chownit, "r"))==NULL){
84
       do_log(LOG_ALERT, "ERR: Can't '%s' !!!", chowncmd);
137
             do_log(LOG_ALERT, "Can't '%s' !!!", chowncmd);
85
       return SCANNER_RET_ERR;
138
             return SCANNER_RET_ERR;
(-)p3scan/files/patch-p3scan.hMon May 1 09:48:22 2006 (+30 lines)
Line 0 Link Here
1
--- p3scan.h.origMon May  1 00:33:38 2006
2
+++ p3scan.hMon May  1 00:36:01 2006
3
@@ -110,21 +110,21 @@
4
 #define VIRUS_SCANNER_VIRUSCODE  1
5
 #define PID_FILE                 "/var/run/p3scan/p3scan.pid"
6
 #define SYSLOG_NAME              "p3scan"
7
-#define CONFIGFILE               "/etc/p3scan/p3scan.conf"
8
-#define VIRUS_TEMPLATE           "/etc/p3scan/p3scan.mail"
9
+#define CONFIGFILE               "/usr/local/etc/p3scan/p3scan.conf"
10
+#define VIRUS_TEMPLATE           "/usr/local/etc/p3scan/p3scan.mail"
11
 #define DEBUG                    0
12
 #define QUIET                    0
13
 #define OVERWRITE                NULL
14
 #define CHECKSPAM                0
15
-#define SPAMCHECK                "/usr/bin/spamc"
16
+#define SPAMCHECK                "/usr/local/bin/spamc"
17
 #define MINSPACE                 10000
18
 #define DELIT                    0
19
 #define SUBJECT                  "[Virus] found in a mail to you:"
20
 #define NOTIFY                   "Per instruction, the message has been deleted."
21
 #define SMTPRSET                 "Virus detected! P3scan rejected message!"
22
-#define XMAIL                    "/bin/mail"
23
-#define FOOTER                   "/etc/p3scan/p3scan.footer"
24
-#define EXTRA                    "/etc/p3scan/p3scan.extra"
25
+#define XMAIL                    "/usr/bin/mail"
26
+#define FOOTER                   "/usr/local/etc/p3scan/p3scan.footer"
27
+#define EXTRA                    "/usr/local/etc/p3scan/p3scan.extra"
28
 #define EMERGCON                 "root@localhost postmaster@localhost"
29
 /* Defaut maximum mail size for scanning. ZERO for no limit! */
30
 #define MAX_SIZE_SCAN            0
(-)p3scan/files/patch-parsefile.cMon May 1 09:48:22 2006 (-8 / +6 lines)
Lines 1-6 Link Here
1
--- parsefile.c.orig Wed Jan  5 20:53:04 2005
1
--- parsefile.c.origMon May  1 00:37:13 2006
2
+++ parsefile.c      Tue Jul 26 11:10:08 2005
2
+++ parsefile.cMon May  1 00:37:47 2006
3
@@ -33,11 +33,12 @@
3
@@ -69,9 +69,10 @@
4
 #include <stdio.h>
4
 #include <stdio.h>
5
 #include <stdlib.h>
5
 #include <stdlib.h>
6
 #include <fcntl.h>
6
 #include <fcntl.h>
Lines 8-16 Link Here
8
+#include <stdlib.h>
8
+#include <stdlib.h>
9
 #include <string.h>
9
 #include <string.h>
10
 #include <sys/stat.h>
10
 #include <sys/stat.h>
11
 #include "parsefile.h"
12
 #include "getline.h"
13
+#include <netinet/in.h>
11
+#include <netinet/in.h>
14
12
 #include "parsefile.h"
15
 #define NONULL(x) ( x==NULL ? "" : x) /* this is nice, found in the mutt code */
13
 #include "getlinep3.h"
16
14
 #include "p3scan.h"
(-)p3scan/files/patch-scanner_avpd_new.cMon May 1 09:48:22 2006 (+18 lines)
Line 0 Link Here
1
--- scanner_avpd_new.c.origMon May  1 00:52:11 2006
2
+++ scanner_avpd_new.cMon May  1 00:53:46 2006
3
@@ -44,7 +44,6 @@
4
 #include <time.h>
5
 #include <sys/time.h>
6
 #include <errno.h>
7
-#include <malloc.h>
8
 #include <sys/un.h>
9
 #include <sys/socket.h>
10
 #include <stdarg.h>
11
@@ -52,6 +51,7 @@
12
 #include <ctype.h>
13
 #include <sys/select.h>
14
 #include <fcntl.h>
15
+#include <netinet/in.h>
16
 
17
 #include "p3scan.h"
18
 
(-)p3scan/files/patch-scanner_bash.cMon May 1 09:48:22 2006 (+12 lines)
Line 0 Link Here
1
--- scanner_bash.c.origMon May  1 00:54:39 2006
2
+++ scanner_bash.cMon May  1 00:54:55 2006
3
@@ -39,8 +39,8 @@
4
 #include <sys/wait.h>
5
 #include <sys/stat.h>
6
 #include <errno.h>
7
-#include <malloc.h>
8
 #include <pcre.h>
9
+#include <netinet/in.h>
10
 
11
 #include "p3scan.h"
12
 #include "parsefile.h"
(-)p3scan/files/patch-scanner_clamd.cMon May 1 10:55:25 2006 (+38 lines)
Line 0 Link Here
1
--- scanner_clamd.c.origMon May  1 10:54:52 2006
2
+++ scanner_clamd.cMon May  1 10:55:00 2006
3
@@ -99,7 +99,10 @@
4
       loc2 = tmp-config->virusscanner+1;
5
       len=strlen(config->virusscanner);
6
       config->clamdport=substr(config->virusscanner,loc2,len);
7
-      config->clamdserver=strndup(config->virusscanner,loc); //TODO: 6 bytes in 1 blocks are definitely lost in loss record 1 of 2
8
+//      config->clamdserver=strndup(config->virusscanner,loc); //TODO: 6 bytes in 1 blocks are definitely lost in loss record 1 of 2
9
+config->clamdserver=malloc(loc+1); 
10
+config->clamdserver=strncpy(config->clamdserver, config->virusscanner, loc);
11
+config->clamdserver[1] = 0;
12
       do_log(LOG_DEBUG, "Reset ClamdServer to: %s Port: %s",config->clamdserver, config->clamdport);
13
    }
14
    bzero(&clamd_pri, sizeof(clamd_pri));
15
@@ -262,7 +265,10 @@
16
    char  *tmp=NULL;
17
 
18
    if (strlen(NONULL(config->virusscanner))<1){
19
-      tmp=strndup(DEFAULT_SERVER,strlen(DEFAULT_SERVER));
20
+      //tmp=strndup(DEFAULT_SERVER,strlen(DEFAULT_SERVER));
21
+tmp=malloc(strlen(DEFAULT_SERVER)+1); 
22
+tmp=strncpy(tmp, DEFAULT_SERVER, loc);
23
+config->clamdserver[1] = 0;
24
       strncat(tmp,":",1);
25
       strncat(tmp,DEFAULT_PORT,4);
26
       config->virusscanner=tmp;
27
@@ -274,7 +280,10 @@
28
       loc2 = tmp-config->virusscanner+1;
29
       len=strlen(config->virusscanner);
30
       config->clamdport=substr(config->virusscanner,loc2,len);
31
-      config->clamdserver=strndup(config->virusscanner,loc); //TODO: 6 bytes in 1 blocks are definitely lost in loss record 1 of 2
32
+      //config->clamdserver=strndup(config->virusscanner,loc); //TODO: 6 bytes in 1 blocks are definitely lost in loss record 1 of 2
33
+config->clamdserver=malloc(loc+1); 
34
+config->clamdserver=strncpy(config->clamdserver, config->virusscanner, loc);
35
+config->clamdserver[1] = 0;
36
       do_log(LOG_DEBUG, "Clamd init. Server: %s Port: %s",config->clamdserver, config->clamdport);
37
    }else{
38
       do_log(LOG_CRIT, "Clamd init unable to locate separator: %s",config->virusscanner);
(-)p3scan/files/pkg-message.inTue May 2 22:41:50 2006 (-3 / +3 lines)
Lines 1-11 Link Here
1
**********************************************************************
1
**********************************************************************
2
2
3
By default, P3Scan is configured to work with McAfee UVSCAN.
3
By default, P3Scan is configured to work with McAfee UVSCAN.
4
Please copy %%PREFIX%%/etc/p3scan.conf.sample to p3scan.conf and modify
4
Please copy %%PREFIX%%/etc/p3scan/p3scan.conf.sample to p3scan.conf and modify
5
%%PREFIX%%/etc/p3scan.conf and/or %%PREFIX%%/etc/rc.d/p3scan.sh to
5
%%PREFIX%%/etc/p3scan/p3scan.conf and/or %%PREFIX%%/etc/rc.d/p3scan.sh to
6
fit your environment.
6
fit your environment.
7
7
8
Don't forget to copy %%PREFIX%%/etc/p3scan.mail.sample to p3scan.mail
8
Don't forget to copy %%PREFIX%%/etc/p3scan/p3scan.mail.sample to p3scan.mail
9
and edit your own template for virus notifications.
9
and edit your own template for virus notifications.
10
10
11
By the way, you need to enable IPFIREWALL and IPFIREWALL_FORWARD options
11
By the way, you need to enable IPFIREWALL and IPFIREWALL_FORWARD options
(-)p3scan/pkg-installTue May 2 22:39:36 2006 (-2 / +2 lines)
Lines 107-114 Link Here
107
exit 1
107
exit 1
108
    fi
108
    fi
109
109
110
    user=p3scan
110
    user=mailnull
111
    group=p3scan
111
    group=mail
112
    spooldir=/var/spool/p3scan
112
    spooldir=/var/spool/p3scan
113
    childrendir=/var/spool/p3scan/children
113
    childrendir=/var/spool/p3scan/children
114
    notifydir=/var/spool/p3scannotify
114
    notifydir=/var/spool/p3scannotify

Return to bug 96673