aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog29
-rw-r--r--NEWS18
-rw-r--r--configure.ac8
-rw-r--r--doc/mailfromd.texi2
-rw-r--r--src/Makefile.am4
-rw-r--r--src/bi_sa.m410
-rw-r--r--src/dns.c13
-rw-r--r--src/dnscache.c9
-rw-r--r--src/gram.y2
-rw-r--r--src/mailfrom.h9
-rw-r--r--src/rate.c5
-rw-r--r--src/snarf.m42
12 files changed, 81 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c7b4a87..c404695f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,38 @@
+2006-12-13 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * NEWS, configure.ac: Version 3.1.1
+ * doc/mailfromd.texi: Fix typo
+ * src/bi_sa.m4 (spamd_send_stream): Assume captured stream already
+ has \r in front of each \n
+ (clamav): always shutdown data stream as a fd-style stream.
+ * src/dns.c (_resolve_ipstr): First argument is const
+ (resolve_ipstr,resolve_hostname): First argument is const
+ * src/dnscache.c (parse_value,dns_make_key)
+ (dns_cache_get,dns_cache_put): keystr is const
+ * src/gram.y (optimize_node): Fix typo that caused correct
+ `matches' conditions to be rejected (e.g. strip_domain_part.mf)
+ * src/mailfrom.h (resolve_ipstr,resolve_hostname): First argument
+ is const
+ (dns_cache_get,dns_cache_put): keystr is const
+ * src/snarf.m4 (MF_BEGIN_TEMP_SPACE): Do not terminate with a
+ semicolon, since the statement is supposed to be used in argument
+ declarations.
+
+2006-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/Makefile.am (install-data-local): Rename leftover
+ MAILFROMSTATEDIR
+ * src/rate.c (get_rate): Bug fix: attempt to free auto storage
+
2006-12-07 Sergey Poznyakoff <gray@gnu.org.ua>
* NEWS, configure.ac: Version 3.1
2006-12-06 Sergey Poznyakoff <gray@gnu.org.ua>
+ * NEWS, configure.ac: Update patchlevel
+ * doc/mailfromd.texi: Finished docs for 3.1
+
* configure.ac (MAILFROMSTATEDIR): Rename to DEFAULT_STATE_DIR
* src/Makefile.am: Likewise
* src/mailfrom.h: Likewise
diff --git a/NEWS b/NEWS
index 3bd80689..4c5ecffa 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,22 @@
-Mailfromd NEWS -- history of user-visible changes. 2006-12-07
+Mailfromd NEWS -- history of user-visible changes. 2006-12-13
Copyright (C) 2005, 2006 Sergey Poznyakoff
See the end of file for copying conditions.
Please send mailfromd bug reports to <bug-mailfromd@gnu.org.ua>
+Version 3.1.1, 2006-12-13
+
+Bugfixes:
+
+* `Make install' creates state directory if it does not exist
+* `clamav' function could cause coredumps when using socket ports.
+* `resolve' function altered its argument if it was a CNAME.
+* A typo in gram.y prevented some correct `matches' conditions from
+being compiled. In particular, strip_domain_part.mf triggered this
+error.
+
+
Version 3.1, 2006-12-07
* Incompatible changes.
@@ -1083,4 +1095,8 @@ Copyright (C) 2005 Sergey Poznyakoff
Local variables:
mode: outline
paragraph-separate: "[ ]*$"
+eval: (add-hook 'write-file-hooks 'time-stamp)
+time-stamp-start: "changes. "
+time-stamp-format: "%:y-%02m-%02d"
+time-stamp-end: "\n"
end:
diff --git a/configure.ac b/configure.ac
index 075fd389..5086d8fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@
AC_PREREQ(2.59)
m4_define([MF_VERSION_MAJOR], 3)
m4_define([MF_VERSION_MINOR], 1)
-dnl m4_define([MF_VERSION_PATCH], 0)
+m4_define([MF_VERSION_PATCH], 1)
AC_INIT([mailfromd],
MF_VERSION_MAJOR.MF_VERSION_MINOR[]m4_ifdef([MF_VERSION_PATCH],.MF_VERSION_PATCH),
[bug-mailfromd@gnu.org.ua])
@@ -382,11 +382,17 @@ AC_DEFINE_UNQUOTED(DEFAULT_EXPIRE_RATES_INTERVAL,
# Doc hints.
# Select a rendition level:
# DISTRIB for stable releases (at most one dot in the version number)
+# and maintenance releases (two dots, patchlevel < 50)
# PROOF for alpha releases.
# PUBLISH can only be required manually when running make in doc/
AC_SUBST(RENDITION)
case `echo $VERSION|sed 's/[[^.]]//g'` in
""|".") RENDITION=DISTRIB;;
+"..") if test `echo $VERSION | sed 's/.*\.//'` -lt 50; then
+ RENDITION=DISTRIB
+ else
+ RENDITION=PROOF
+ fi;;
*) RENDITION=PROOF;;
esac
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index 03caeed5..0491b1da 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -6184,7 +6184,7 @@ latter case, a log message is also issued:
@group
prog envfrom
do
- catch &fail or &temp_failure
+ catch &failure or &temp_failure
do
echo "Caught exception " $1
continue
diff --git a/src/Makefile.am b/src/Makefile.am
index dbb01f39..0398a40e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -75,6 +75,6 @@ AM_YFLAGS=-dtv
AM_LFLAGS=-dvp
install-data-local:
- -test -d $(DESTDIR)$(MAILFROMSTATEDIR) || \
- $(mkinstalldirs) -o $(DEFAULT_USER) $(DESTDIR)$(MAILFROMSTATEDIR)
+ -test -d $(DESTDIR)$(DEFAULT_STATE_DIR) || \
+ $(mkinstalldirs) -o $(DEFAULT_USER) $(DESTDIR)$(DEFAULT_STATE_DIR)
diff --git a/src/bi_sa.m4 b/src/bi_sa.m4
index 0fb1cee8..f5584190 100644
--- a/src/bi_sa.m4
+++ b/src/bi_sa.m4
@@ -130,16 +130,8 @@ spamd_send_stream(mu_stream_t stream, mu_stream_t instr)
while (mu_stream_sequential_readline(instr, buf, sizeof(buf),
&size) == 0
&& size > 0) {
- char *nl = NULL;
-
- if (buf[size-1] == '\n') {
- size--;
- nl = "\r\n";
- }
debug3(80,"<< %*.*s", size, size, buf);
mu_stream_sequential_write (stream, buf, size);
- if (nl)
- mu_stream_sequential_write (stream, nl, 2);
}
}
@@ -472,7 +464,7 @@ MF_DEFUN(clamav, NUMBER, STRING urlstr)
handler = set_signal_handler(SIGPIPE, sigpipe_handler);
spamd_send_stream(dstr, mstr);
- spamd_shutdown(dstr, isfile, SHUT_WR);
+ spamd_shutdown(dstr, 0, SHUT_WR);
set_signal_handler(SIGPIPE, handler);
rc = spamd_read_line(cstr, buffer, sizeof buffer, NULL);
diff --git a/src/dns.c b/src/dns.c
index f9408144..5b49b932 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -447,14 +447,15 @@ cnameloop(struct loop_data *lp)
}
mf_status
-_resolve_ipstr(char *ipstr, char *answer, size_t answer_size,
+_resolve_ipstr(const char *ipstr, char *answer, size_t answer_size,
char *hbuf, size_t hbsize, unsigned long *ttl)
{
int i;
char revipstr[3*4+3+1];
char namebuf[NSIZE];
char domainbuf[NSIZE];
- char *p, *q;
+ const char *p;
+ char *q;
struct loop_data ld;
q = revipstr + strlen (ipstr);
@@ -498,7 +499,7 @@ _resolve_ipstr(char *ipstr, char *answer, size_t answer_size,
}
mf_status
-resolve_ipstr(char *ipstr, char **phbuf)
+resolve_ipstr(const char *ipstr, char **phbuf)
{
mf_status status;
static unsigned char *answer;
@@ -565,7 +566,7 @@ _resolve_hostname(char *host, char *answer, size_t answer_size,
}
mf_status
-resolve_hostname(char *host, char **pipbuf)
+resolve_hostname(const char *host, char **pipbuf)
{
mf_status status;
static unsigned char *answer;
@@ -587,12 +588,14 @@ resolve_hostname(char *host, char **pipbuf)
} else {
unsigned long ttl;
struct in_addr s;
+ char *tmphost = xstrdup(host);
MUTEX_LOCK(mf_mutex);
- status = _resolve_hostname(host, answer, MAXPACKET,
+ status = _resolve_hostname(tmphost, answer, MAXPACKET,
buffer.cbuf, sizeof buffer.cbuf,
&ttl);
MUTEX_UNLOCK(mf_mutex);
+ free(tmphost);
switch (status) {
case mf_success:
s.s_addr = buffer.abuf;
diff --git a/src/dnscache.c b/src/dnscache.c
index 13a12c69..d8410de1 100644
--- a/src/dnscache.c
+++ b/src/dnscache.c
@@ -31,7 +31,7 @@
#include "mailfrom.h"
static mf_status
-parse_value(int qtype, char *keystr,
+parse_value(int qtype, const char *keystr,
int argc, char **argv, char **rbuf, size_t rcnt)
{
size_t i;
@@ -62,7 +62,7 @@ parse_value(int qtype, char *keystr,
}
static int
-dns_make_key(int type, char *keystr, DBM_DATUM *key)
+dns_make_key(int type, const char *keystr, DBM_DATUM *key)
{
char *p;
char *pfx;
@@ -101,7 +101,7 @@ dns_free_key(DBM_DATUM *key)
}
mf_status
-dns_cache_get(int type, char *keystr, char **rbuf, size_t rcnt)
+dns_cache_get(int type, const char *keystr, char **rbuf, size_t rcnt)
{
mf_status rc;
DBM_FILE db;
@@ -148,7 +148,8 @@ dns_cache_get(int type, char *keystr, char **rbuf, size_t rcnt)
}
void
-dns_cache_put(int type, char *keystr, time_t ttl, char **rbuf, size_t rcnt)
+dns_cache_put(int type, const char *keystr, time_t ttl,
+ char **rbuf, size_t rcnt)
{
mf_status rc;
DBM_FILE db;
diff --git a/src/gram.y b/src/gram.y
index 9309c5d6..19e44ecf 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -3122,7 +3122,7 @@ optimize_node(NODE *node)
} else
node->v.bin.qualifier &=
~QUALIFIER_REGFREE;
- } else if (arg1->type == node_type_regcomp) {
+ } else if (arg1->type != node_type_regcomp) {
parse_error_locus(&arg1->locus,
"right-hand side argument "
"to match is "
diff --git a/src/mailfrom.h b/src/mailfrom.h
index 9a6a2bd8..1dde0217 100644
--- a/src/mailfrom.h
+++ b/src/mailfrom.h
@@ -134,8 +134,8 @@ enum smtp_state {
#define MAXMXCOUNT 32
typedef char *mxbuf_t[MAXMXCOUNT];
-mf_status resolve_ipstr(char *ipstr, char **hbuf);
-mf_status resolve_hostname(char *host, char **pipbuf);
+mf_status resolve_ipstr(const char *ipstr, char **hbuf);
+mf_status resolve_hostname(const char *host, char **pipbuf);
mf_status getmx(char *ipstr, mxbuf_t mxbuf);
void freemx(mxbuf_t mxbuf);
@@ -795,8 +795,9 @@ void cache_insert(char *email, mf_status rc);
mf_status cache_get2(char *email, char *client_addr);
void cache_insert2(char *email, char *client_addr, mf_status rc);
-mf_status dns_cache_get(int type, char *keystr, char **rbuf, size_t rcnt);
-void dns_cache_put(int type, char *keystr, time_t ttl, char **rbuf,
+mf_status dns_cache_get(int type, const char *keystr, char **rbuf,
+ size_t rcnt);
+void dns_cache_put(int type, const char *keystr, time_t ttl, char **rbuf,
size_t rcnt);
mf_status get_rate(char *email, double *ret);
diff --git a/src/rate.c b/src/rate.c
index 781999a1..49e607c0 100644
--- a/src/rate.c
+++ b/src/rate.c
@@ -36,6 +36,7 @@ get_rate(char *email, double *ret)
DBM_FILE db;
DBM_DATUM key;
DBM_DATUM contents;
+ int local_contents = 0;
struct rate_result *rp, rate;
double result;
time_t t;
@@ -67,6 +68,7 @@ get_rate(char *email, double *ret)
rate.interval = 0;
rate.count = 0;
rp = &rate;
+ local_contents = 1;
}
/* Update the structure */
@@ -94,7 +96,8 @@ get_rate(char *email, double *ret)
if (mu_dbm_insert(&db, key, contents, 1))
mu_error ("Cannot insert datum");
- mu_dbm_datum_free(&contents);
+ if (!local_contents)
+ mu_dbm_datum_free(&contents);
mu_dbm_close(&db);
*ret = result;
diff --git a/src/snarf.m4 b/src/snarf.m4
index d21e04ae..4924fee0 100644
--- a/src/snarf.m4
+++ b/src/snarf.m4
@@ -252,7 +252,7 @@ dnl MF_BEGIN_TEMP_SPACE and MF_END_TEMP_SPACE/MF_RETURN_TEMP_SPACE
dnl
define([<MF_BEGIN_TEMP_SPACE>],[<dnl
size_t $2;
-char *$1 = heap_max_tempspace(env, &size);
+char *$1 = heap_max_tempspace(env, &size)
pushdef([<__TEMP_SPACE_PTR__>],$1)>])
dnl MF_END_TEMP_SPACE - Cancel temporary heap allocation initiated by

Return to:

Send suggestions and report system problems to the System administrator.