]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-1.1.11-20021106
authorWietse Venema <wietse@porcupine.org>
Wed, 6 Nov 2002 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:24 +0000 (06:28 +0000)
postfix/.indent.pro
postfix/HISTORY
postfix/html/postsuper.1.html
postfix/man/man1/postsuper.1
postfix/src/global/mail_version.h
postfix/src/postalias/postalias.c
postfix/src/postsuper/postsuper.c
postfix/src/util/dict_pcre.c
postfix/src/util/dict_regexp.c

index 3da9d6444cbe2a49af1b507deb3b8098d4cf0eb6..1d142f92de9e9ad002c6dea6bf4b8a39decd5fee 100644 (file)
@@ -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
index f4c4660a4866e561e11b9c28741e1389cd4b4bc0..f997e92183592b3fa3b5ec869300209a1eab2784 100644 (file)
@@ -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.
index 4bafed3de5e68866ecf97c5299b248f3435312ec..41c331be12d0a7e5962ae5da1db603c1955d8d22 100644 (file)
@@ -5,8 +5,8 @@ POSTSUPER(1)                                         POSTSUPER(1)
        postsuper - Postfix superintendent
 
 <b>SYNOPSIS</b>
-       <b>postsuper</b> [<b>-cpsv</b>] [<b>-d</b> <i>queue_id</i>] [<b>-h</b> <i>queue_id</i>] [<b>-H</b>
-       <i>queue_id</i>] [<b>-r</b> <i>queue_id</i>] [<i>directory</i> <i>...</i>]
+       <b>postsuper</b> [<b>-psv</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>queue_id</i>] [<b>-h</b>
+       <i>queue_id</i>] [<b>-H</b> <i>queue_id</i>] [<b>-r</b> <i>queue_id</i>] [<i>directory</i> <i>...</i>]
 
 <b>DESCRIPTION</b>
        The <b>postsuper</b> command does maintenance jobs on the Postfix
index f5074b87cbcf75cd7fac53b201728866d6505a05..d0e70879d6b7d149665a033401c5d596a9108e54 100644 (file)
@@ -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
index e87391dfe5b4d912a005255603f6347ede8c71c2..0d7643fbc60b72970981a325863c026e4d7fb584 100644 (file)
@@ -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
index ab377d55d935aaf2e19f2694123370ae66f315e1..72c2588b51de3b9c91d0641ed768ec0e58c73595 100644 (file)
 #include <readlline.h>
 #include <stringops.h>
 #include <split_at.h>
-#include <get_hostname.h>
 #include <vstring_vstream.h>
 #include <set_eugid.h>
 
@@ -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.
index c746796712b1e4963efdc401c0bc3ff87346e8ad..d830fe79a2ab72af14937a700b1ba465e693b8a7 100644 (file)
@@ -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
index 534c1ad196babfa0b7563e369b4f693182b016ee..d51c47f8606c041197eeb1d41793d39a2d815d51 100644 (file)
@@ -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);
index fbd0f24f0709fb7b46e61d7733d063d888d8d52b..c67c48b1d146e71a524df88f935bcbaaaafd2f40 100644 (file)
@@ -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);
        }