mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-31 06:05:37 +00:00
postfix-2.10-20120426
This commit is contained in:
committed by
Viktor Dukhovni
parent
84b6e12c12
commit
7313937caf
@@ -17738,3 +17738,11 @@ Apologies for any names omitted.
|
||||
Workaround: bugs in 10-year old gcc versions break compilation
|
||||
with #ifdef inside a macro invocation (NOT: definition).
|
||||
Files: tls/tls.h, tls/tls_client.c, tls/tls_server.c.
|
||||
|
||||
20120426
|
||||
|
||||
Bugfix (introduced Postfix 2.9): postconf flagged parameters
|
||||
defined in master.cf as "unused" when they were used only
|
||||
in main.cf. Problem reported by Michael Tokarev. Files:
|
||||
postconf/postconf_user.c, postconf/test4b.ref, postconf
|
||||
Makefile.in.
|
||||
|
@@ -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 "20120425"
|
||||
#define MAIL_RELEASE_DATE "20120426"
|
||||
#define MAIL_VERSION_NUMBER "2.10"
|
||||
|
||||
#ifdef SNAPSHOT
|
||||
|
@@ -42,7 +42,7 @@ test: $(TESTPROG)
|
||||
|
||||
tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \
|
||||
test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 \
|
||||
test22 test23 test24 test25 test26 test27 test28 test29 test30
|
||||
test22 test23 test24 test25 test26 test27 test28 test29 test30 test4b
|
||||
|
||||
root_tests:
|
||||
|
||||
@@ -80,7 +80,7 @@ test2: $(PROG) test2.ref
|
||||
diff test2.ref test2.tmp
|
||||
rm -f main.cf master.cf test2.tmp
|
||||
|
||||
# Define one parameter in main,cf, validate it with main.cf.
|
||||
# Define one parameter in main.cf, validate it with main.cf.
|
||||
|
||||
test3: $(PROG) test3.ref
|
||||
rm -f main.cf master.cf
|
||||
@@ -105,6 +105,21 @@ test4: $(PROG) test4.ref
|
||||
diff test4.ref test4.tmp
|
||||
rm -f main.cf master.cf test4.tmp
|
||||
|
||||
# Define one parameter in master.cf, validate it with main.cf.
|
||||
|
||||
test4b: $(PROG) test4b.ref
|
||||
rm -f main.cf master.cf
|
||||
touch main.cf master.cf
|
||||
echo 'always_bcc = $$foo' >> main.cf
|
||||
echo 'biff = $$bar' >> main.cf
|
||||
echo 'bar = aaa' >> main.cf
|
||||
echo smtpd1 unix - n n - 0 smtpd >> master.cf
|
||||
echo ' -o foo=xxx -o bar=yyy -o baz=zzz' >> master.cf
|
||||
echo '#smtpd1 unix - n n - 0 smtpd' >> master.cf
|
||||
./$(PROG) -nc . >test4b.tmp 2>&1
|
||||
diff test4b.ref test4b.tmp
|
||||
rm -f main.cf master.cf test4b.tmp
|
||||
|
||||
# Define one user-defined parameter with name=value in master.cf,
|
||||
# validate it with known_parameter=$$name in master.cf.
|
||||
|
||||
|
@@ -126,15 +126,28 @@ static const char *flag_user_parameter(const char *mac_name,
|
||||
* compatibility after a feature name change.
|
||||
*/
|
||||
if (local_scope && dict_get(local_scope->all_params, mac_name)) {
|
||||
/* $name in master.cf references name=value in master.cf. */
|
||||
if (PC_PARAM_TABLE_LOCATE(local_scope->valid_names, mac_name) == 0)
|
||||
PC_PARAM_TABLE_ENTER(local_scope->valid_names, mac_name,
|
||||
PC_PARAM_FLAG_USER, PC_PARAM_NO_DATA,
|
||||
convert_user_parameter);
|
||||
} else if (mail_conf_lookup(mac_name) != 0) {
|
||||
/* $name in main/master.cf references name=value in main.cf. */
|
||||
if (PC_PARAM_TABLE_LOCATE(param_table, mac_name) == 0)
|
||||
PC_PARAM_TABLE_ENTER(param_table, mac_name, PC_PARAM_FLAG_USER,
|
||||
PC_PARAM_NO_DATA, convert_user_parameter);
|
||||
}
|
||||
if (local_scope == 0) {
|
||||
for (local_scope = master_table; local_scope->argv; local_scope++) {
|
||||
if (local_scope->all_params != 0
|
||||
&& dict_get(local_scope->all_params, mac_name) != 0
|
||||
/* $name in main.cf references name=value in master.cf. */
|
||||
&& PC_PARAM_TABLE_LOCATE(local_scope->valid_names, mac_name) == 0)
|
||||
PC_PARAM_TABLE_ENTER(local_scope->valid_names, mac_name,
|
||||
PC_PARAM_FLAG_USER, PC_PARAM_NO_DATA,
|
||||
convert_user_parameter);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -277,21 +290,7 @@ void register_user_parameters(void)
|
||||
rest_class_table = htable_create(1);
|
||||
|
||||
/*
|
||||
* Scan parameter values that are left at their defaults in the global
|
||||
* name space. Some defaults contain the $name of an obsolete parameter
|
||||
* for backwards compatilility purposes. We might warn that an explicit
|
||||
* name=value is obsolete, but we must not warn that the parameter is
|
||||
* unused.
|
||||
*/
|
||||
scan_default_parameter_values(param_table, CONFIG_DICT, (PC_MASTER_ENT *) 0);
|
||||
|
||||
/*
|
||||
* Scan the explicit name=value entries in the global name space.
|
||||
*/
|
||||
scan_user_parameter_namespace(CONFIG_DICT, (PC_MASTER_ENT *) 0);
|
||||
|
||||
/*
|
||||
* Scan the "-o parameter=value" instances in each master.cf name space.
|
||||
* Initialize the per-service parameter name spaces.
|
||||
*/
|
||||
for (masterp = master_table; (argv = masterp->argv) != 0; masterp++) {
|
||||
for (field = PC_MASTER_MIN_FIELDS; argv->argv[field] != 0; field++) {
|
||||
@@ -309,7 +308,27 @@ void register_user_parameters(void)
|
||||
if ((dict = dict_handle(masterp->name_space)) != 0) {
|
||||
masterp->all_params = dict;
|
||||
masterp->valid_names = htable_create(1);
|
||||
scan_user_parameter_namespace(masterp->name_space, masterp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan parameter values that are left at their defaults in the global
|
||||
* name space. Some defaults contain the $name of an obsolete parameter
|
||||
* for backwards compatilility purposes. We might warn that an explicit
|
||||
* name=value is obsolete, but we must not warn that the parameter is
|
||||
* unused.
|
||||
*/
|
||||
scan_default_parameter_values(param_table, CONFIG_DICT, (PC_MASTER_ENT *) 0);
|
||||
|
||||
/*
|
||||
* Scan the explicit name=value entries in the global name space.
|
||||
*/
|
||||
scan_user_parameter_namespace(CONFIG_DICT, (PC_MASTER_ENT *) 0);
|
||||
|
||||
/*
|
||||
* Scan the "-o parameter=value" instances in each master.cf name space.
|
||||
*/
|
||||
for (masterp = master_table; masterp->argv != 0; masterp++)
|
||||
if (masterp->all_params != 0)
|
||||
scan_user_parameter_namespace(masterp->name_space, masterp);
|
||||
}
|
||||
|
5
postfix/src/postconf/test4b.ref
Normal file
5
postfix/src/postconf/test4b.ref
Normal file
@@ -0,0 +1,5 @@
|
||||
always_bcc = $foo
|
||||
bar = aaa
|
||||
biff = $bar
|
||||
config_directory = .
|
||||
./postconf: warning: ./master.cf: unused parameter: baz=zzz
|
Reference in New Issue
Block a user