From: Wietse Venema Date: Wed, 6 Nov 2002 05:00:00 +0000 (-0500) Subject: postfix-1.1.11-20021106 X-Git-Tag: v2.0.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0650222d2dee2ed899474382cc3509c8bca5f3e;p=thirdparty%2Fpostfix.git postfix-1.1.11-20021106 --- diff --git a/postfix/.indent.pro b/postfix/.indent.pro index 3da9d6444..1d142f92d 100644 --- a/postfix/.indent.pro +++ b/postfix/.indent.pro @@ -43,6 +43,7 @@ -TDICT_PCRE_EXPAND_CONTEXT -TDICT_PCRE_IF_RULE -TDICT_PCRE_MATCH_RULE +-TDICT_PCRE_PRESCAN_CONTEXT -TDICT_PCRE_REGEXP -TDICT_PCRE_RULE -TDICT_REGEXP diff --git a/postfix/HISTORY b/postfix/HISTORY index f4c4660a4..f997e9218 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -7149,6 +7149,22 @@ Apologies for any names omitted. postmap and postalias only) to remove some hurdles for Michael Tokarev's CDB support. Files: global/mkmap*.[hc]. +20021105 + + Postalias now produces YP_LAST_MODIFIED and YP_MASTER_NAME + records only when NIS support is compiled in. File: + postalias.c. + +20021106 + + Postalias now puts $myhostname in the YP_MASTER_NAME record, + instead of the possibly bogus gethostname() result. File: + postalias.c. + + The PCRE map code did not reject non-numeric replacement + indices in replacement text, and silently treated $text as + $0. Found by Michael Tokarev. File: dict_pcre.c. + Open problems: Low: revise other local delivery agent duplicate filters. @@ -7160,6 +7176,9 @@ Open problems: Low: sendmail does not store null command-line recipients. + Low: sendmail, not cleanup, should extract recipients from + message headers. + Low: have a configurable list of errno values for mailbox or maildir delivery that result in deferral rather than bouncing mail. diff --git a/postfix/html/postsuper.1.html b/postfix/html/postsuper.1.html index 4bafed3de..41c331be1 100644 --- a/postfix/html/postsuper.1.html +++ b/postfix/html/postsuper.1.html @@ -5,8 +5,8 @@ POSTSUPER(1) POSTSUPER(1) postsuper - Postfix superintendent SYNOPSIS - postsuper [-cpsv] [-d queue_id] [-h queue_id] [-H - queue_id] [-r queue_id] [directory ...] + postsuper [-psv] [-c config_dir] [-d queue_id] [-h + queue_id] [-H queue_id] [-r queue_id] [directory ...] DESCRIPTION The postsuper command does maintenance jobs on the Postfix diff --git a/postfix/man/man1/postsuper.1 b/postfix/man/man1/postsuper.1 index f5074b87c..d0e70879d 100644 --- a/postfix/man/man1/postsuper.1 +++ b/postfix/man/man1/postsuper.1 @@ -9,7 +9,8 @@ Postfix superintendent .na .nf .fi -\fBpostsuper\fR [\fB-cpsv\fR] [\fB-d \fIqueue_id\fR] +\fBpostsuper\fR [\fB-psv\fR] +[\fB-c \fIconfig_dir\fR] [\fB-d \fIqueue_id\fR] [\fB-h \fIqueue_id\fR] [\fB-H \fIqueue_id\fR] [\fB-r \fIqueue_id\fR] [\fIdirectory ...\fR] .SH DESCRIPTION diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index e87391dfe..0d7643fbc 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only, unless they include the same bugfix as a patch release. */ -#define MAIL_RELEASE_DATE "20021104" +#define MAIL_RELEASE_DATE "20021106" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index ab377d55d..72c2588b5 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -162,7 +162,6 @@ #include #include #include -#include #include #include @@ -329,8 +328,10 @@ static void postalias(char *map_type, char *path_name, int postalias_flags, mkmap->dict->flags &= ~DICT_FLAG_TRY1NULL; mkmap->dict->flags |= DICT_FLAG_TRY0NULL; vstring_sprintf(value_buffer, "%010ld", (long) time((time_t *) 0)); +#if (defined(HAS_NIS) || defined(HAS_NISPLUS)) mkmap_append(mkmap, "YP_LAST_MODIFIED", STR(value_buffer)); - mkmap_append(mkmap, "YP_MASTER_NAME", get_hostname()); + mkmap_append(mkmap, "YP_MASTER_NAME", var_myhostname); +#endif /* * Close the alias database, and release the lock. diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index c74679671..d830fe79a 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -5,7 +5,8 @@ /* Postfix superintendent /* SYNOPSIS /* .fi -/* \fBpostsuper\fR [\fB-cpsv\fR] [\fB-d \fIqueue_id\fR] +/* \fBpostsuper\fR [\fB-psv\fR] +/* [\fB-c \fIconfig_dir\fR] [\fB-d \fIqueue_id\fR] /* [\fB-h \fIqueue_id\fR] [\fB-H \fIqueue_id\fR] /* [\fB-r \fIqueue_id\fR] [\fIdirectory ...\fR] /* DESCRIPTION diff --git a/postfix/src/util/dict_pcre.c b/postfix/src/util/dict_pcre.c index 534c1ad19..d51c47f86 100644 --- a/postfix/src/util/dict_pcre.c +++ b/postfix/src/util/dict_pcre.c @@ -125,6 +125,14 @@ typedef struct { int matches; /* Count of cuts */ } DICT_PCRE_EXPAND_CONTEXT; + /* + * Context for $number pre-scan callback. + */ +typedef struct { + const char *mapname; /* name of regexp map */ + int lineno; /* where in file */ +} DICT_PCRE_PRESCAN_CONTEXT; + /* * Compatibility. */ @@ -414,6 +422,29 @@ static int dict_pcre_get_pattern(const char *mapname, int lineno, char **bufp, return (1); } +/* dict_pcre_prescan - sanity check $number instances in replacement text */ + +static int dict_pcre_prescan(int type, VSTRING *buf, char *context) +{ + DICT_PCRE_PRESCAN_CONTEXT *ctxt = (DICT_PCRE_PRESCAN_CONTEXT *) context; + size_t n; + + if (type == MAC_PARSE_VARNAME) { + if (!alldig(vstring_str(buf))) { + msg_warn("pcre map %s, line %d: non-numeric replacement index \"%s\"", + ctxt->mapname, ctxt->lineno, vstring_str(buf)); + return (MAC_PARSE_ERROR); + } + n = atoi(vstring_str(buf)); + if (n < 1) { + msg_warn("pcre map %s, line %d: out of range replacement index \"%s\"", + ctxt->mapname, ctxt->lineno, vstring_str(buf)); + return (MAC_PARSE_ERROR); + } + } + return (MAC_PARSE_OK); +} + /* dict_pcre_compile - compile pattern */ static int dict_pcre_compile(const char *mapname, int lineno, @@ -472,6 +503,7 @@ static DICT_PCRE_RULE *dict_pcre_parse_rule(const char *mapname, int lineno, if (!ISALNUM(*p)) { DICT_PCRE_REGEXP regexp; DICT_PCRE_ENGINE engine; + DICT_PCRE_PRESCAN_CONTEXT prescan_context; DICT_PCRE_MATCH_RULE *match_rule; /* @@ -489,6 +521,19 @@ static DICT_PCRE_RULE *dict_pcre_parse_rule(const char *mapname, int lineno, msg_warn("%s, line %d: no replacement text: using empty string", mapname, lineno); + /* + * Sanity check the $number instances in the replacement text. + */ + prescan_context.mapname = mapname; + prescan_context.lineno = lineno; + + if (mac_parse(p, dict_pcre_prescan, (char *) &prescan_context) + & MAC_PARSE_ERROR) { + msg_warn("pcre map %s, line %d: bad replacement syntax: " + "skipping this rule", mapname, lineno); + return (0); + } + /* * Compile the pattern. */ @@ -646,8 +691,8 @@ DICT *dict_pcre_open(const char *mapname, int unused_flags, int dict_flags) } if (nesting) - msg_warn("pcre map %s, line %d: more IFs than ENDIFs", - mapname, lineno); + msg_warn("pcre map %s, line %d: more IFs than ENDIFs", + mapname, lineno); vstring_free(line_buffer); vstream_fclose(map_fp); diff --git a/postfix/src/util/dict_regexp.c b/postfix/src/util/dict_regexp.c index fbd0f24f0..c67c48b1d 100644 --- a/postfix/src/util/dict_regexp.c +++ b/postfix/src/util/dict_regexp.c @@ -443,9 +443,14 @@ static int dict_regexp_get_pats(const char *mapname, int lineno, char **p, return (0); if (**p == '!') { #if 0 - msg_warn("regexp file %s, line %d: /pattern1/!/pattern2/ goes away, " - "use \"if !/pattern2/ ... /pattern1/ ... endif\" instead", - mapname, lineno); + static int bitrot_warned = 0; + + if (bitrot_warned == 0) { + msg_warn("regexp file %s, line %d: /pattern1/!/pattern2/ goes away," + " use \"if !/pattern2/ ... /pattern1/ ... endif\" instead", + mapname, lineno); + bitrot_warned = 1; + } #endif if (dict_regexp_get_pat(mapname, lineno, p, second_pat) == 0) return (0); @@ -464,7 +469,7 @@ static int dict_regexp_prescan(int type, VSTRING *buf, char *context) if (type == MAC_PARSE_VARNAME) { if (!alldig(vstring_str(buf))) { - msg_warn("regexp map %s, line %d: non-numeric replacement macro name \"%s\"", + msg_warn("regexp map %s, line %d: non-numeric replacement index \"%s\"", ctxt->mapname, ctxt->lineno, vstring_str(buf)); return (MAC_PARSE_ERROR); }