o update to dspam 3.8.0 mostly from brad@

o fix dspamc that was busted in the 3.8.0 release, verified to work via testing
This commit is contained in:
todd 2007-12-21 14:42:23 +00:00
parent 7b9837ea35
commit 8779cd4b60
13 changed files with 153 additions and 72 deletions

View File

@ -1,11 +1,10 @@
# $OpenBSD: Makefile,v 1.22 2007/09/06 19:15:13 naddy Exp $
# $OpenBSD: Makefile,v 1.23 2007/12/21 14:42:23 todd Exp $
COMMENT= anti-spam filter
VERSION= 3.6.8
VERSION= 3.8.0
DISTNAME= dspam-${VERSION}
PKGNAME= ${DISTNAME}p4
SHARED_LIBS= dspam 7.0
SHARED_LIBS= dspam 8.0
CATEGORIES= mail
MASTER_SITES= http://dspam.nuclearelephant.com/sources/
@ -21,11 +20,9 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c m
USE_LIBTOOL= Yes
CONFIGURE_STYLE= gnu
SEPARATE_BUILD= concurrent
USE_LIBTOOL= Yes
CONFIGURE_ARGS+= --with-dspam-home=/var/dspam \
--with-dspam-home-owner=_dspam \
--with-dspam-home-group=_dspam \

View File

@ -1,5 +1,5 @@
MD5 (dspam-3.6.8.tar.gz) = xLGnB5aQ7hbYsPNrKiqQpA==
RMD160 (dspam-3.6.8.tar.gz) = k6cNsUBwy2G9LvGwylWhi+Hb/Xs=
SHA1 (dspam-3.6.8.tar.gz) = 6MQTiC6t8eAoN+Si/8/Ji4Ae3tE=
SHA256 (dspam-3.6.8.tar.gz) = iMe0H7gekLqKJgiFodFLzjny70oGzCxri/oLmboa7DQ=
SIZE (dspam-3.6.8.tar.gz) = 743275
MD5 (dspam-3.8.0.tar.gz) = BWuMizrZQVpSwBsi/x5kzw==
RMD160 (dspam-3.8.0.tar.gz) = 54MeJBXjDoGd2cvAuj8mnhE+L7k=
SHA1 (dspam-3.8.0.tar.gz) = 0d5+4hNFIq2vUvSRZ6zOzxWJ+pY=
SHA256 (dspam-3.8.0.tar.gz) = hKInk0p67nNRa9uCwz7ns1npVcjNlaFUSpoTBp95v8c=
SIZE (dspam-3.8.0.tar.gz) = 726160

View File

@ -1,16 +1,16 @@
$OpenBSD: patch-UPGRADING,v 1.2 2006/01/22 04:10:42 brad Exp $
--- UPGRADING.orig Tue Jan 17 15:49:08 2006
+++ UPGRADING Sat Jan 21 22:54:40 2006
@@ -13,8 +13,10 @@ UPGRADING FROM < 3.6.1
$OpenBSD: patch-UPGRADING,v 1.3 2007/12/21 14:42:23 todd Exp $
--- UPGRADING.orig Sun Mar 18 17:42:25 2007
+++ UPGRADING Sun Apr 29 18:02:34 2007
@@ -16,9 +16,9 @@ UPGRADING FROM 3.6
log file selection. This is now required.
- For users of hash_drv: A cssconvert tool has been provided to convert all
v3.6.0 databases to the correct, 8-byte aligned format used in all newer
- versions. Please run cssconvert on all of your .css databases before
- turning on your new version of dspam.
+ versions.
+
+ The OpenBSD port of DSPAM 3.6.0 already used the correctly aligned format,
+ so that you don't need to run cssconvert before upgrading to 3.6.1 and later.
3. Ensure 3.6.0 malaligned hash databases are converted
- Version 3.6.0 failed to align hash databases to 8-byte boundaries. If you
- are upgrading from v3.6.0 and are using the hash_drv storage driver, you
- should run cssconvert to upgrade your .css files to a fully aligned format.
+ Version 3.6.0 failed to align hash databases to 8-byte boundaries. The
+ OpenBSD port of DSPAM 3.6.0 already used the correctly aligned format,
+ so that you don't need to run cssconvert.
UPGRADING FROM < 3.6.0
----------------------
4. Invert "SupressWebStats" setting in dspam.conf
SupressWebStats has been changed to simply WebStats, and the setting is

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-src_agent_shared_c,v 1.3 2007/12/21 14:42:23 todd Exp $
--- src/agent_shared.c.orig Thu Dec 20 18:03:30 2007
+++ src/agent_shared.c Thu Dec 20 18:03:08 2007
@@ -913,3 +913,18 @@ int process_parseto(AGENT_CTX *ATX, const char *buf) {
return 0;
}
+
+int
+init_pwent_cache()
+{
+ struct passwd *pwent;
+ pwent = getpwuid(getuid());
+ if (pwent == NULL) {
+ return 0;
+ }
+ else {
+ __pw_name = strdup(pwent->pw_name);
+ __pw_uid = pwent->pw_uid;
+ }
+ return 1;
+}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_agent_shared_h,v 1.1 2007/12/21 14:42:23 todd Exp $
--- src/agent_shared.h.orig Thu Dec 20 18:03:38 2007
+++ src/agent_shared.h Thu Dec 20 18:03:54 2007
@@ -107,6 +107,8 @@ int initialize_atx (AGENT_CTX *ATX);
int process_parseto (AGENT_CTX *ATX, const char *buf);
buffer *read_stdin (AGENT_CTX *ATX);
+int init_pwent_cache();
+
#ifndef MIN
# define MAX(a,b) ((a)>(b)?(a):(b))
# define MIN(a,b) ((a)<(b)?(a):(b))

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
--- src/client.c.orig Wed Feb 15 21:06:35 2006
+++ src/client.c Thu Apr 27 10:03:28 2006
@@ -108,7 +108,7 @@ int client_process(AGENT_CTX *ATX, buffe
$OpenBSD: patch-src_client_c,v 1.4 2007/12/21 14:42:23 todd Exp $
--- src/client.c.orig Thu May 25 17:36:39 2006
+++ src/client.c Sun Apr 29 17:57:52 2007
@@ -108,7 +108,7 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
/* RCPT TO - Send recipient information */
@ -10,7 +10,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
node_nt = c_nt_first(ATX->users, &c_nt);
while(node_nt != NULL) {
const char *ptr = (const char *) node_nt->ptr;
@@ -170,7 +170,7 @@ int client_process(AGENT_CTX *ATX, buffe
@@ -170,7 +170,7 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
if (ATX->flags & DAF_SUMMARY)
head = 1;
@ -19,7 +19,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
while(line != NULL && strcmp(line, ".")) {
chomp(line);
@@ -192,7 +192,7 @@ int client_process(AGENT_CTX *ATX, buffe
@@ -192,7 +192,7 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
break;
}
free(line);
@ -28,7 +28,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
if (line) chomp(line);
}
free(line);
@@ -200,7 +200,7 @@ int client_process(AGENT_CTX *ATX, buffe
@@ -200,7 +200,7 @@ int client_process(AGENT_CTX *ATX, buffer *message) {
goto BAIL;
} else {
for(i=0;i<ATX->users->items;i++) {
@ -37,7 +37,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
char *x;
int code = 500;
@@ -313,7 +313,7 @@ int client_connect(AGENT_CTX *ATX, int f
@@ -313,7 +313,7 @@ int client_connect(AGENT_CTX *ATX, int flags) {
if (domain) {
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
saun.sun_family = AF_UNIX;
@ -46,7 +46,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
addr_len = sizeof(saun.sun_family) + strlen(saun.sun_path) + 1;
LOGDEBUG(INFO_CLIENT_CONNECTING, host, 0);
@@ -443,7 +443,7 @@ char * client_expect(THREAD_CTX *TTX, in
@@ -443,7 +443,7 @@ char * client_expect(THREAD_CTX *TTX, int code, char *
char *inp, *dup, *ptr, *ptrptr;
int recv_code;
@ -55,7 +55,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
while(inp != NULL) {
recv_code = 0;
dup = strdup(inp);
@@ -467,7 +467,7 @@ char * client_expect(THREAD_CTX *TTX, in
@@ -467,7 +467,7 @@ char * client_expect(THREAD_CTX *TTX, int code, char *
strlcpy(err, inp, len);
free(inp);
@ -64,7 +64,7 @@ $OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
}
return NULL;
@@ -512,13 +512,13 @@ int client_getcode(THREAD_CTX *TTX, char
@@ -512,13 +512,13 @@ int client_getcode(THREAD_CTX *TTX, char *err, size_t
char *inp, *ptr, *ptrptr;
int i;

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-src_daemon_c,v 1.3 2006/03/23 17:17:40 todd Exp $
--- src/daemon.c.orig Mon Mar 6 17:23:43 2006
+++ src/daemon.c Mon Mar 6 17:24:26 2006
$OpenBSD: patch-src_daemon_c,v 1.4 2007/12/21 14:42:23 todd Exp $
--- src/daemon.c.orig Tue Jun 13 16:43:12 2006
+++ src/daemon.c Sun Apr 29 17:57:52 2007
@@ -549,7 +549,7 @@ void *process_connection(void *ptr) {
while(ATX->users->items == 0 || invalid) {
@ -19,7 +19,7 @@ $OpenBSD: patch-src_daemon_c,v 1.3 2006/03/23 17:17:40 todd Exp $
}
if (cmdline == NULL)
@@ -873,7 +873,7 @@ buffer * read_sock(THREAD_CTX *TTX, AGEN
@@ -875,7 +875,7 @@ buffer * read_sock(THREAD_CTX *TTX, AGENT_CTX *ATX) {
body = 1;
}
@ -28,7 +28,7 @@ $OpenBSD: patch-src_daemon_c,v 1.3 2006/03/23 17:17:40 todd Exp $
chomp(buf);
if (!strcmp(buf, ".")) {
@@ -956,7 +956,7 @@ char *daemon_expect(THREAD_CTX *TTX, con
@@ -958,7 +958,7 @@ char *daemon_expect(THREAD_CTX *TTX, const char *comma
char buf[128];
char *cmd;
@ -37,7 +37,7 @@ $OpenBSD: patch-src_daemon_c,v 1.3 2006/03/23 17:17:40 todd Exp $
if (cmd == NULL)
return NULL;
@@ -979,7 +979,7 @@ char *daemon_expect(THREAD_CTX *TTX, con
@@ -981,7 +981,7 @@ char *daemon_expect(THREAD_CTX *TTX, const char *comma
if (send_socket(TTX, buf)<=0)
return NULL;
free(cmd);

View File

@ -1,16 +1,40 @@
$OpenBSD: patch-src_dspam_c,v 1.7 2006/06/08 14:41:08 todd Exp $
--- src/dspam.c.orig Tue May 30 17:03:55 2006
+++ src/dspam.c Wed Jun 7 13:36:39 2006
@@ -387,7 +387,7 @@ process_message (
$OpenBSD: patch-src_dspam_c,v 1.8 2007/12/21 14:42:23 todd Exp $
--- src/dspam.c.orig Tue Dec 12 09:33:45 2006
+++ src/dspam.c Thu Dec 20 18:07:56 2007
@@ -108,7 +108,6 @@ main (int argc, char *argv[])
int exitcode = EXIT_SUCCESS;
struct nt_node *node_nt;
struct nt_c c_nt;
- struct passwd *pwent;
srand ((long) time << (long) getpid ());
umask (006); /* rw-rw---- */
@@ -123,14 +122,11 @@ main (int argc, char *argv[])
/* Cache my username and uid for trusted user security */
- pwent = getpwuid(getuid());
- if (pwent == NULL) {
+ if (!init_pwent_cache()) {
LOG(LOG_ERR, ERR_AGENT_RUNTIME_USER);
exitcode = EXIT_FAILURE;
goto BAIL;
}
- __pw_name = strdup(pwent->pw_name);
- __pw_uid = pwent->pw_uid;
/* Read dspam.conf into global config structure (ds_config_t) */
@@ -402,7 +398,7 @@ process_message (
CTX->confidence = 1.0;
STATUS("A virus was detected in the message contents");
result = DSR_ISSPAM;
- strcpy(CTX->class, LANG_CLASS_VIRUS);
+ strlcpy(CTX->class, LANG_CLASS_VIRUS, sizeof (CTX->class));
internally_canned = 1;
}
}
@@ -400,7 +400,7 @@ process_message (
if (!dspam_getsource (CTX, ip, sizeof (ip)))
{
@@ -419,7 +415,7 @@ process_message (
result = DSR_ISSPAM;
CTX->probability = 1.0;
CTX->confidence = 1.0;
@ -19,7 +43,7 @@ $OpenBSD: patch-src_dspam_c,v 1.7 2006/06/08 14:41:08 todd Exp $
internally_canned = 1;
}
@@ -420,7 +420,7 @@ process_message (
@@ -439,7 +435,7 @@ process_message (
result = DSR_ISSPAM;
CTX->probability = 1.0;
CTX->confidence = 1.0;
@ -28,7 +52,7 @@ $OpenBSD: patch-src_dspam_c,v 1.7 2006/06/08 14:41:08 todd Exp $
internally_canned = 1;
}
}
@@ -751,10 +751,10 @@ process_message (
@@ -786,10 +782,10 @@ process_message (
switch (CTX->result) {
case DSR_ISSPAM:
@ -41,7 +65,7 @@ $OpenBSD: patch-src_dspam_c,v 1.7 2006/06/08 14:41:08 todd Exp $
break;
}
@@ -1019,7 +1019,7 @@ int tag_message(AGENT_CTX *ATX, ds_messa
@@ -1054,7 +1050,7 @@ int tag_message(AGENT_CTX *ATX, ds_message_t message)
int tagged = 0;
char spam_subject[16];
@ -50,7 +74,7 @@ $OpenBSD: patch-src_dspam_c,v 1.7 2006/06/08 14:41:08 todd Exp $
if (_ds_pref_val(ATX->PTX, "spamSubject")[0] != '\n' &&
_ds_pref_val(ATX->PTX, "spamSubject")[0] != 0)
{
@@ -1593,7 +1593,7 @@ int process_users(AGENT_CTX *ATX, buffer
@@ -1616,7 +1612,7 @@ int process_users(AGENT_CTX *ATX, buffer *message) {
if (parse_message == NULL) {
LOG(LOG_CRIT, ERR_MEM_ALLOC);
presult->exitcode = ERC_PROCESS;

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-src_dspamc_c,v 1.1 2007/12/21 14:42:23 todd Exp $
--- src/dspamc.c.orig Thu Dec 20 18:00:46 2007
+++ src/dspamc.c Thu Dec 20 18:01:59 2007
@@ -99,6 +99,7 @@ main (int argc, char *argv[])
int exitcode = EXIT_SUCCESS;
buffer *message = NULL; /* input Message */
int agent_init = 0; /* agent is initialized */
+ struct passwd *pwent;
setbuf (stdout, NULL); /* unbuffered output */
#ifdef DEBUG
@@ -112,6 +113,14 @@ main (int argc, char *argv[])
LOG(LOG_ERR, ERR_DAEMON_NO_SUPPORT);
exit(EXIT_FAILURE);
#endif
+
+ /* Cache my username and uid for trusted user security */
+
+ if (!init_pwent_cache()) {
+ LOG(LOG_ERR, ERR_AGENT_RUNTIME_USER);
+ exitcode = EXIT_FAILURE;
+ goto BAIL;
+ }
/* Read dspam.conf into global config structure (ds_config_t) */

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_list_c,v 1.1 2005/10/26 06:18:39 jakob Exp $
--- src/list.c.orig Sat Oct 1 06:32:18 2005
+++ src/list.c Mon Oct 17 14:48:42 2005
@@ -116,7 +116,7 @@ bnr_list_insert (struct bnr_list *list,
$OpenBSD: patch-src_list_c,v 1.2 2007/12/21 14:42:23 todd Exp $
--- src/list.c.orig Sat May 13 03:12:59 2006
+++ src/list.c Sun Apr 29 17:57:52 2007
@@ -116,7 +116,7 @@ bnr_list_insert (struct bnr_list *list, void *data, fl
perror("memory allocation error: list_insert() failed");
return NULL;
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_mysql_drv_c,v 1.5 2006/06/08 14:41:08 todd Exp $
--- src/mysql_drv.c.orig Sat Jun 3 05:15:49 2006
+++ src/mysql_drv.c Wed Jun 7 13:36:39 2006
@@ -1361,7 +1361,7 @@ _ds_get_nextuser (DSPAM_CTX * CTX)
$OpenBSD: patch-src_mysql_drv_c,v 1.6 2007/12/21 14:42:23 todd Exp $
--- src/mysql_drv.c.orig Thu Sep 21 20:25:19 2006
+++ src/mysql_drv.c Sun Apr 29 17:57:52 2007
@@ -1362,7 +1362,7 @@ _ds_get_nextuser (DSPAM_CTX * CTX)
virtual_username,
virtual_table);
#else

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_pgsql_drv_c,v 1.3 2006/06/08 14:41:08 todd Exp $
--- src/pgsql_drv.c.orig Tue Jun 6 17:46:06 2006
+++ src/pgsql_drv.c Wed Jun 7 13:36:39 2006
@@ -1146,7 +1146,7 @@ _ds_get_signature (DSPAM_CTX * CTX, stru
$OpenBSD: patch-src_pgsql_drv_c,v 1.4 2007/12/21 14:42:23 todd Exp $
--- src/pgsql_drv.c.orig Sat Jul 29 15:38:48 2006
+++ src/pgsql_drv.c Sun Apr 29 17:57:52 2007
@@ -1146,7 +1146,7 @@ _ds_get_signature (DSPAM_CTX * CTX, struct _ds_spam_si
p = _pgsql_drv_getpwuid (CTX, uid);
if (!p) {

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_util_c,v 1.2 2005/11/23 08:52:49 jakob Exp $
--- src/util.c.orig Wed Oct 26 19:39:32 2005
+++ src/util.c Tue Nov 8 16:13:59 2005
@@ -278,7 +278,7 @@ const char * _ds_userdir_path (char *pat
$OpenBSD: patch-src_util_c,v 1.3 2007/12/21 14:42:23 todd Exp $
--- src/util.c.orig Sat May 13 03:12:59 2006
+++ src/util.c Sun Apr 29 17:57:52 2007
@@ -278,7 +278,7 @@ const char * _ds_userdir_path (char *path, const char
#endif
if (p == NULL)
@ -10,7 +10,7 @@ $OpenBSD: patch-src_util_c,v 1.2 2005/11/23 08:52:49 jakob Exp $
else
strlcpy(userhome, p->pw_dir, sizeof(userhome));
@@ -307,7 +307,7 @@ const char * _ds_userdir_path (char *pat
@@ -307,7 +307,7 @@ const char * _ds_userdir_path (char *path, const char
free(f);
#else
strlcpy(username, filename, MAX_FILENAME_LENGTH);
@ -19,7 +19,7 @@ $OpenBSD: patch-src_util_c,v 1.2 2005/11/23 08:52:49 jakob Exp $
#endif
/* Use home/opt-in/ and home/opt-out/ to store opt files, instead of
@@ -748,6 +748,7 @@ inet_ntoa_r(struct in_addr in, char *buf
@@ -748,6 +748,7 @@ inet_ntoa_r(struct in_addr in, char *buf, int len)
return(NULL);
}