summaryrefslogtreecommitdiff
path: root/mail/pop3vscan/files/patch-pop3vscan.c
blob: 80c2af892c8e68df77a29e5b789559e59a94ecc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- pop3vscan.c.orig	Wed Jun 12 08:19:05 2002
+++ pop3vscan.c	Tue Jun  3 03:23:38 2003
@@ -27,11 +27,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <arpa/inet.h>
+#include <sys/types.h>
 #include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <arpa/inet.h>
 #include <netinet/ip.h>
 #include <sys/socket.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -44,8 +45,8 @@
 #include <syslog.h>
 #include <sys/param.h>
 #include <ctype.h>
-#include <linux/netfilter_ipv4.h>
-#include <malloc.h>
+//#include <linux/netfilter_ipv4.h>
+#include <stdlib.h>
 #include <getopt.h>
 #include <netdb.h>
 #include <libgen.h>
@@ -66,14 +67,14 @@
 /* default configuration, anything can be changed at runtime {{{1 */
 #define PORT_NUMBER		8110
 #define MAX_CHILDS		10
-#define RUNAS_USER		"mail"
+#define RUNAS_USER		"pop3vscan"
 #define VIRUS_DIR		"/var/spool/pop3vscan"
 #define VIRUS_SCANNER		NULL
 #define VIRUS_SCANNER_VIRUSCODE	1
 #define PID_FILE		"/var/run/pop3vscan.pid"
 #define SYSLOG_NAME		"pop3vscan"
-#define CONFIGFILE		"/etc/pop3vscan.conf"
-#define VIRUS_TEMPLATE		"/etc/pop3vscan.mail"
+#define CONFIGFILE		PREFIX"/etc/pop3vscan.conf"
+#define VIRUS_TEMPLATE		PREFIX"/etc/pop3vscan.mail"
 #define DEBUG			0
 /* TOS:  do not set, or use IPTOS_[LOWDELAY|THROUGHPUT|RELIABILITY|LOWCOST] */
 #define SET_TOS			IPTOS_THROUGHPUT
@@ -519,8 +520,8 @@
 		inet_ntoa(p->client_addr.sin_addr), ntohs(p->client_addr.sin_port));
 
     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 (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",