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:
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
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.
* 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);
}
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++) {
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);
}