openbsd-ports/mail/dspam/patches/patch-src_client_c
landry 37e7a819d5 Update to dspam 3.10.2.
- remove 6 out of the 10 flavors maze, only keep the ones that make
  sense (ie clamav, ldap, domainscale & largescale)
- build pgsql & mysql drivers as subpackages, as $DEITY intended
- @pkgpath & PFRAG.[flavor]-main tweaks from sthen@ (thanks!)
- remove init_pwent_cache() patch until i can make some sense of it
- remove painful strlcpy patches
- add patches to fix pgsql support with PSQL > 9.1 from
  http://sourceforge.net/p/dspam/bug-tracker/112/ &
http://sourceforge.net/p/dspam/bug-tracker/141
- add an rc script running dspam --daemon as _dspam
- patch default dspam.conf to trust user _dspam (pointed out by jca@;
  thanks!) and to use port 2424 by default. Taken from debian.

Discussed at length with todd@ (MAINTAINER), been running on amd64 with
pgsql &| sqlite backend since a while, also tested on sqlite/ppc.

Some tweaks might still be needed (a README ? Fix some weird crashers ?),
but at least it's better than what we had for the past years.
2013-09-14 17:12:10 +00:00

90 lines
2.6 KiB
Plaintext

$OpenBSD: patch-src_client_c,v 1.5 2013/09/14 17:12:12 landry Exp $
--- src/client.c.orig Wed Apr 11 20:48:33 2012
+++ src/client.c Sun Sep 8 22:16:35 2013
@@ -108,7 +108,7 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
/* RCPT TO - Send recipient information */
- strcpy(buf, "RCPT TO: ");
+ strlcpy(buf, "RCPT TO: ", sizeof (buf));
node_nt = c_nt_first(ATX->users, &c_nt);
while(node_nt != NULL) {
const char *ptr = (const char *) node_nt->ptr;
@@ -211,7 +211,7 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
if (ATX->flags & DAF_SUMMARY)
head = 1;
- line = client_getline(&TTX, 300);
+ line = client_getline(&TTX, 900);
while(line != NULL && strcmp(line, ".")) {
chomp(line);
@@ -231,13 +231,13 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
printf("%s\n", line);
}
free(line);
- line = client_getline(&TTX, 300);
+ line = client_getline(&TTX, 900);
if (line) chomp(line);
}
free(line);
} else {
for(i=0;i<ATX->users->items;i++) {
- char *input = client_getline(&TTX, 300);
+ char *input = client_getline(&TTX, 900);
char *x;
int code = 500;
@@ -304,7 +304,7 @@ int client_connect(AGENT_CTX *ATX, int flags) {
struct sockaddr_un saun;
int sockfd;
int yes = 1;
- int port = 24;
+ int port = 2424;
int domain = 0;
int addr_len;
char *host;
@@ -354,7 +354,7 @@ int client_connect(AGENT_CTX *ATX, int flags) {
if (domain) {
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
saun.sun_family = AF_UNIX;
- strcpy(saun.sun_path, host);
+ strlcpy(saun.sun_path, host, sizeof (saun.sun_path));
addr_len = sizeof(saun.sun_family) + strlen(saun.sun_path) + 1;
LOGDEBUG(INFO_CLIENT_CONNECTING, host, 0);
@@ -484,7 +484,7 @@ char * client_expect(THREAD_CTX *TTX, int code, char *
char *inp, *dup, *ptr, *ptrptr;
int recv_code;
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
while(inp != NULL) {
recv_code = 0;
dup = strdup(inp);
@@ -508,7 +508,7 @@ char * client_expect(THREAD_CTX *TTX, int code, char *
strlcpy(err, inp, len);
free(inp);
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
}
return NULL;
@@ -553,13 +553,13 @@ int client_getcode(THREAD_CTX *TTX, char *err, size_t
char *inp, *ptr, *ptrptr = NULL;
int i;
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
if (!inp)
return EFAILURE;
while(inp && !strncmp(inp, "250-", 4)) {
free(inp);
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
}
strlcpy(err, inp, len);