]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.10-20130113
authorWietse Venema <wietse@porcupine.org>
Sun, 13 Jan 2013 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:38:26 +0000 (06:38 +0000)
postfix/HISTORY
postfix/html/postconf.5.html
postfix/man/man5/postconf.5
postfix/proto/postconf.proto
postfix/src/global/mail_version.h
postfix/src/postconf/Makefile.in
postfix/src/postconf/postconf_dbms.c
postfix/src/postconf/postconf_master.c
postfix/src/postconf/test28.ref
postfix/src/postconf/test29.ref
postfix/src/util/argv.c

index f1237ed8fbe1597642f718cdc862aa0d4e70ebfa..534b439ac1278d144e8dcfd03628a9baaae1e3b1 100644 (file)
@@ -18208,3 +18208,19 @@ Apologies for any names omitted.
        master.cf options parser didn't support "clusters" of
        command-line option letters. Files: postconf/postconf_master.c,
        postconf/test40.ref.
+
+20130105
+
+       Undo a change made around 20121224, and always whitelist
+       configuration parameter names for legacy-style proxy:ldap:prefix
+       etc.  lookup tables.  Files: postconf/postconf_dbms.c,
+       postconf/test28.ref, postconf/test29.ref, postconf/Makefile.in.
+
+20130107
+
+       Factor out the master.cf line parser so that it can be
+       reused for "postconf -Me". File: postconf/postconf_master.c.
+
+20130113
+
+       Start of work on integrating a pile of new code.
index af5878dd749df2f1295452be354e603b07a50844..3db2d3f10aeefb14bbaefe23a8491a58307d1f21 100644 (file)
@@ -1737,6 +1737,12 @@ the process marches on. If you use an X-based debugger, be sure to
 set up your XAUTHORITY environment variable before starting Postfix.
 </p>
 
+<p>
+Note: the command is subject to $name expansion, before it is
+passed to the default commmand interpreter. Specify "$$" to
+produce a single "$" character.
+</p>
+
 <p>
 Example:
 </p>
index 5c0164575ade2cdfcb74ad7c9a6e80dcccd9f22e..2c547b4938373322304861ba8d4b75d5423123ed 100644 (file)
@@ -1004,6 +1004,10 @@ Use "command .. & sleep 5" so that the debugger can attach before
 the process marches on. If you use an X-based debugger, be sure to
 set up your XAUTHORITY environment variable before starting Postfix.
 .PP
+Note: the command is subject to $name expansion, before it is
+passed to the default commmand interpreter. Specify "$$" to
+produce a single "$" character.
+.PP
 Example:
 .PP
 .nf
index 307c10d1170e558c1750e37f575ce776e215975d..9283bc6a9d8f6489966a35aece5d418cc0cec077 100644 (file)
@@ -6810,6 +6810,12 @@ the process marches on. If you use an X-based debugger, be sure to
 set up your XAUTHORITY environment variable before starting Postfix.
 </p>
 
+<p>
+Note: the command is subject to $name expansion, before it is
+passed to the default commmand interpreter. Specify "$$" to
+produce a single "$" character.
+</p>
+
 <p>
 Example:
 </p>
index 61019449d7d5f052f58d0d2d7d7d03305d2bad97..86532ce2e85e2da25963cb845941320a474712d0 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20130101"
+#define MAIL_RELEASE_DATE      "20130113"
 #define MAIL_VERSION_NUMBER    "2.10"
 
 #ifdef SNAPSHOT
index 66c565cc1957da080b419a6c0f2a8a38e3a31cec..85864a2a6f08c7a1ab4cfa33da9f500d8a0ebb96 100644 (file)
@@ -377,7 +377,7 @@ test27:     $(PROG) test27.ref
 test28:        $(PROG) test28.ref
        rm -f main.cf master.cf
        touch main.cf master.cf
-       echo 'xx = ldap:foo' >> main.cf
+       echo 'xx = proxy:ldap:foo' >> main.cf
        echo 'foo_domain = bar' >> main.cf
        echo 'header_checks = ldap:hh' >> main.cf
        echo 'hh_domain = whatever' >> main.cf
@@ -397,19 +397,19 @@ test28:   $(PROG) test28.ref
 test29:        $(PROG) test29.ref
        rm -f main.cf master.cf
        touch main.cf master.cf
-       echo 'ldapxx = ldap:ldapfoo' >> main.cf
+       echo 'ldapxx = proxy:ldap:ldapfoo' >> main.cf
        echo 'ldapfoo_domain = bar' >> main.cf
        echo 'ldapfoo_domainx = bar' >> main.cf
-       echo 'mysqlxx = mysql:mysqlfoo' >> main.cf
+       echo 'mysqlxx = proxy:mysql:mysqlfoo' >> main.cf
        echo 'mysqlfoo_domain = bar' >> main.cf
        echo 'mysqlfoo_domainx = bar' >> main.cf
-       echo 'pgsqlxx = pgsql:pgsqlfoo' >> main.cf
+       echo 'pgsqlxx = proxy:pgsql:pgsqlfoo' >> main.cf
        echo 'pgsqlfoo_domain = bar' >> main.cf
        echo 'pgsqlfoo_domainx = bar' >> main.cf
-       echo 'sqlitexx = sqlite:sqlitefoo' >> main.cf
+       echo 'sqlitexx = proxy:sqlite:sqlitefoo' >> main.cf
        echo 'sqlitefoo_domain = bar' >> main.cf
        echo 'sqlitefoo_domainx = bar' >> main.cf
-       echo 'memcachexx = memcache:memcachefoo' >> main.cf
+       echo 'memcachexx = proxy:memcache:memcachefoo' >> main.cf
        echo 'memcachefoo_domain = bar' >> main.cf
        echo 'memcachefoo_domainx = bar' >> main.cf
        ./$(PROG) -nc . >test29.tmp 2>&1
index 128a8adda8dc990a58d116ef0f74dc8ca15bfdc1..9d12bd8b3fb28bf43bca1ae24aecfdf3e1d693df 100644 (file)
@@ -172,17 +172,21 @@ void    register_dbms_parameters(const char *param_value,
     while ((db_type = mystrtok(&bufp, " ,\t\r\n")) != 0) {
 
        /*
-        * Don't skip over "proxy:" indirections. They don't introduce
-        * database-specific main.cf parameters on the proxy client side.
-        * 
-        * Look for database:prefix where the prefix is not a pathname and the
-        * database is a known type. Synthesize candidate parameter names
+        * Skip over "proxy:" maptypes, to emulate the proxymap(8) server's
+        * behavior when opening a local database configuration file.
+        */
+       while ((prefix = split_at(db_type, ':')) != 0
+              && strcmp(db_type, DICT_TYPE_PROXY) == 0)
+           db_type = prefix;
+
+       /*
+        * Look for database:prefix where the prefix is not a pathname and
+        * the database is a known type. Synthesize candidate parameter names
         * from the user-defined prefix and from the database-defined suffix
         * list, and see if those parameters have a "name=value" entry in the
         * local or global namespace.
         */
-       if ((prefix = split_at(db_type, ':')) != 0
-           && *prefix != '/' && *prefix != '.') {
+       if (prefix != 0 && *prefix != '/' && *prefix != '.') {
            for (dp = dbms_info; dp->db_type != 0; dp++) {
                if (strcmp(db_type, dp->db_type) == 0) {
                    for (cpp = dp->db_suffixes; *cpp; cpp++) {
index 251d94eb86b71c3d9f68165ef7c711a647d3f940..9bf79a78ec5b871597ef48fd25aacc3f06dc1d84 100644 (file)
@@ -101,7 +101,7 @@ static void normalize_options(ARGV *argv)
                junk = concatenate("-", cp, (char *) 0);
                argv_insert_one(argv, field + 1, junk);
                myfree(junk);
-               *cp = 0;
+               *cp = 0;                        /* XXX argv_replace_one() */
                break;
            }
        }
@@ -111,7 +111,7 @@ static void normalize_options(ARGV *argv)
        if (arg[2] != 0) {
            /* Split "-oname=value" into "-o" "name=value". */
            argv_insert_one(argv, field + 1, arg + 2);
-           arg[2] = 0;
+           arg[2] = 0;                         /* XXX argv_replace_one() */
            field += 1;
        } else if (argv->argv[field + 1] != 0) {
            /* Already in "-o" "name=value" form. */
@@ -120,6 +120,36 @@ static void normalize_options(ARGV *argv)
     }
 }
 
+/* parse_master_line - parse one master line */
+
+static void parse_master_line(PC_MASTER_ENT *masterp, const char *buf,
+                                     const char *path, int line_count)
+{
+    ARGV   *argv;
+
+    /*
+     * We can't use the master daemon's master_ent routines in their current
+     * form. They convert everything to internal form, and they skip disabled
+     * services.
+     * 
+     * The postconf command needs to show default fields as "-", and needs to
+     * know about all service names so that it can generate service-dependent
+     * parameter names (transport-dependent etc.).
+     */
+#define MASTER_BLANKS  " \t\r\n"               /* XXX */
+
+    argv = argv_split(buf, MASTER_BLANKS);
+    if (argv->argc < PC_MASTER_MIN_FIELDS)
+       msg_fatal("file %s: line %d: bad field count",
+                 path, line_count);
+    normalize_options(argv);
+    masterp->name_space =
+       concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0);
+    masterp->argv = argv;
+    masterp->valid_names = 0;
+    masterp->all_params = 0;
+}
+
 /* read_master - read and digest the master.cf file */
 
 void    read_master(int fail_on_open_error)
@@ -127,7 +157,6 @@ void    read_master(int fail_on_open_error)
     const char *myname = "read_master";
     char   *path;
     VSTRING *buf;
-    ARGV   *argv;
     VSTREAM *fp;
     int     entry_count = 0;
     int     line_count = 0;
@@ -145,17 +174,6 @@ void    read_master(int fail_on_open_error)
        set_config_dir();
     path = concatenate(var_config_dir, "/", MASTER_CONF_FILE, (char *) 0);
 
-    /*
-     * We can't use the master daemon's master_ent routines in their current
-     * form. They convert everything to internal form, and they skip disabled
-     * services.
-     * 
-     * The postconf command needs to show default fields as "-", and needs to
-     * know about all service names so that it can generate service-dependent
-     * parameter names (transport-dependent etc.).
-     */
-#define MASTER_BLANKS  " \t\r\n"               /* XXX */
-
     /*
      * Initialize the in-memory master table.
      */
@@ -174,16 +192,8 @@ void    read_master(int fail_on_open_error)
        while (readlline(buf, fp, &line_count) != 0) {
            master_table = (PC_MASTER_ENT *) myrealloc((char *) master_table,
                                 (entry_count + 2) * sizeof(*master_table));
-           argv = argv_split(STR(buf), MASTER_BLANKS);
-           if (argv->argc < PC_MASTER_MIN_FIELDS)
-               msg_fatal("file %s: line %d: bad field count",
-                         path, line_count);
-           normalize_options(argv);
-           master_table[entry_count].name_space =
-               concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0);
-           master_table[entry_count].argv = argv;
-           master_table[entry_count].valid_names = 0;
-           master_table[entry_count].all_params = 0;
+           parse_master_line(master_table + entry_count, STR(buf),
+                             path, line_count);
            entry_count += 1;
        }
        vstream_fclose(fp);
index f3310e1d9b7dbfe0ef8386dceb2c284e6cf8a3ba..a16ae5e020b8eda295a0e7f332aaf873ed930ad4 100644 (file)
@@ -7,4 +7,4 @@ yy = aap
 zz_domain = whatever
 ./postconf: warning: ./main.cf: unused parameter: zz=$yy
 ./postconf: warning: ./main.cf: unused parameter: aa_domain=whatever
-./postconf: warning: ./main.cf: unused parameter: xx=ldap:foo
+./postconf: warning: ./main.cf: unused parameter: xx=proxy:ldap:foo
index 8ab8fdb53c4d04aaaad2c0859544760b9688ea1f..75a2efafd320031dae88c71633539adbacb16cb8 100644 (file)
@@ -4,13 +4,13 @@ memcachefoo_domain = bar
 mysqlfoo_domain = bar
 pgsqlfoo_domain = bar
 sqlitefoo_domain = bar
-./postconf: warning: ./main.cf: unused parameter: sqlitexx=sqlite:sqlitefoo
-./postconf: warning: ./main.cf: unused parameter: pgsqlxx=pgsql:pgsqlfoo
+./postconf: warning: ./main.cf: unused parameter: sqlitexx=proxy:sqlite:sqlitefoo
+./postconf: warning: ./main.cf: unused parameter: pgsqlxx=proxy:pgsql:pgsqlfoo
 ./postconf: warning: ./main.cf: unused parameter: memcachefoo_domainx=bar
 ./postconf: warning: ./main.cf: unused parameter: sqlitefoo_domainx=bar
-./postconf: warning: ./main.cf: unused parameter: memcachexx=memcache:memcachefoo
-./postconf: warning: ./main.cf: unused parameter: mysqlxx=mysql:mysqlfoo
-./postconf: warning: ./main.cf: unused parameter: ldapxx=ldap:ldapfoo
+./postconf: warning: ./main.cf: unused parameter: memcachexx=proxy:memcache:memcachefoo
+./postconf: warning: ./main.cf: unused parameter: mysqlxx=proxy:mysql:mysqlfoo
+./postconf: warning: ./main.cf: unused parameter: ldapxx=proxy:ldap:ldapfoo
 ./postconf: warning: ./main.cf: unused parameter: ldapfoo_domainx=bar
 ./postconf: warning: ./main.cf: unused parameter: pgsqlfoo_domainx=bar
 ./postconf: warning: ./main.cf: unused parameter: mysqlfoo_domainx=bar
index de2d4b3291a4b400bb2968e7e5848e1198d3346f..7a0ce1f152b98df4dadb5fbaf5b8698facc0950f 100644 (file)
@@ -256,7 +256,7 @@ void    argv_insert_one(ARGV *argvp, ssize_t where, const char *arg)
     argvp->argc += 1;
 }
 
-/* argv_replace_one - insert one string into array */
+/* argv_replace_one - replace one string in array */
 
 void    argv_replace_one(ARGV *argvp, ssize_t where, const char *arg)
 {