RELEASE_NOTES to postconf(5) manpage, and changed the wording
of the BC messages. Files: RELEASE_NOTES, proto/postconf.proto,
master/master_ent.c, smtpd/smtpd.c, trivial-rewrite/rewrite.c.
+
+20141003
+
+ Workaround: kludge for multiple paragraphs of text in indented
+ paragraphs. Files: mantools/postconf2html, mantools/postconf2man,
+ proto/Makefile.in, proto/postconf.proto
+
+20141005
+
+ Cleanup: CHARSET_COMMA_SP, CHARSET_SPACE and CHARSET_BRACE
+ to prepare for the elimination of ad-hoc string constants.
+ File: util/sys_defs.h.
+
+ Cleanup: allow "{ name=value }" to protect whitespace in
+ import_environment and export_environment. Files:
+ proto/postconf.proto, global/mail_parm_split.c, global
+ /mail_parm_split.h, global/mail_stream.c, local/command.c,
+ master/master.c, pipe/pipe.c, postdrop/postdrop.c,
+ postfix/postfix.c, postmulti/postmulti.c, postqueue/postqueue.c,
+ spawn/spawn.c.
Things to do after the stable release:
+ Other things that we might want to break: relay_domains,
+ parent_domain_matches_subdomains. This requires a new
+ compatibility_level.
+
Update smtputf8_enable in postconf(5)
use "static const char myname[] ..."
The <a href="local.8.html"><b>local</b>(8)</a>, <a href="pipe.8.html"><b>pipe</b>(8)</a>, <a href="spawn.8.html"><b>spawn</b>(8)</a>, and <a href="virtual.8.html"><b>virtual</b>(8)</a> daemons require
privileges.
- <b>Chroot (default: Postfix</b> ><b>= 2.12: y, Postfix</b> <<b>2.12: n)</b>
+ <b>Chroot (default: Postfix</b> ><b>= 2.12: n, Postfix</b> <<b>2.12: y)</b>
Whether or not the service runs chrooted to the mail queue
directory (pathname is controlled by the <b><a href="postconf.5.html#queue_directory">queue_directory</a></b> config-
uration variable in the <a href="postconf.5.html">main.cf</a> file).
with the <b><a href="postconf.5.html#debugger_command">debugger_command</a></b> variable in the <a href="postconf.5.html">main.cf</a> config-
uration file. See <a href="DEBUG_README.html">DEBUG_README</a> for hints and tips.
- <b>-o</b> <i>name</i>=<i>value</i> (short form)
+ <b>-o {</b> <i>name</i> = <i>value</i> <b>}</b> (long form, Postfix >= 2.12)
- <b>-o {</b> <i>name</i> = <i>value</i> <b>}</b> (Postfix 2.12 and later)
+ <b>-o</b> <i>name</i>=<i>value</i> (short form)
Override the named <a href="postconf.5.html">main.cf</a> configuration parameter. The
parameter value can refer to other parameters as <i>$name</i>
etc., just like in <a href="postconf.5.html">main.cf</a>. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
- NOTE 1: with the "short form" shown above, do not specify
- whitespace around the "=" or in parameter values. To
- specify a parameter value that contains whitespace, use
+ NOTE 1: With the "long form" shown above, whitespace
+ after "{" and before "}" is ignored.
+
+ NOTE 2: with the "short form" shown above, do not specify
+ whitespace around the "=" or in parameter values. To
+ specify a parameter value that contains whitespace, use
commas instead of spaces, or specify the value in
<a href="postconf.5.html">main.cf</a>. Example:
/etc/postfix/<a href="postconf.5.html">main.cf</a>
submission_mumble = text with whitespace...
- NOTE 2: Over-zealous use of parameter overrides makes the
- Postfix configuration hard to understand and maintain.
- At a certain point, it might be easier to configure mul-
+ NOTE 3: Over-zealous use of parameter overrides makes the
+ Postfix configuration hard to understand and maintain.
+ At a certain point, it might be easier to configure mul-
tiple instances of Postfix, instead of configuring multi-
ple personalities via <a href="master.5.html">master.cf</a>.
- <b>-v</b> Increase the verbose logging level. Specify multiple <b>-v</b>
- options to make a Postfix daemon process increasingly
+ <b>-v</b> Increase the verbose logging level. Specify multiple <b>-v</b>
+ options to make a Postfix daemon process increasingly
verbose.
Other command-line arguments
Specify "{" and "}" around command arguments that contain
- whitespace (Postfix 2.12 and later). Whitespace immedi-
- ately after "{" and before "}" is ignored.
+ whitespace (Postfix 2.12 and later). Whitespace after "{"
+ and before "}" is ignored.
<b>SEE ALSO</b>
<a href="master.8.html">master(8)</a>, process manager
interpreter.
Specify "{" and "}" around command arguments that contain white-
- space (Postfix 2.12 and later). Whitespace immediately after "{"
- and before "}" is ignored.
+ space (Postfix 2.12 and later). Whitespace after "{" and before
+ "}" is ignored.
In the command argument vector, the following macros are recog-
nized and replaced with corresponding information from the Post-
"value2". This form is supported with Postfix versions ≥ 2.12.
</p>
-<li> <p> Instead of a parameter name, the first item inside "${...}"
-may be a logical expression of the form: "{value3} == {value4}"
-(equality) or "{value3} != {value4}" (inequality). This form is
-supported with Postfix versions ≥ 2.12. </p>
+<li> <p> The first item inside "${...}" may be a logical expression
+of the form: "{value3} == {value4}". Besides the "==" (equality)
+operator Postfix supports "!=" (inequality), "<", "≤", "≥",
+and ">". The comparison is numerical when both operands are all
+digits, otherwise the comparison is lexicographical. These forms
+are supported with Postfix versions ≥ 2.12. </p>
<li> <p> Each "value" is subject to recursive named parameter and
logical expression evaluation, except where noted. </p>
<a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> default settings after an upgrade to a newer
but incompatible Postfix version. </p>
-<p> While the backwards-compatible default settings are in effect,
-Postfix logs what services or what email would be affected by
-the incompatible change. </p>
+<p> While backwards compatibility is in effect, Postfix logs what
+services or what email would be affected by the incompatible change.
+</p>
+
+<p> As detailed below, based on this logging the system administrator
+can determine whether or not a backwards-compatible default setting
+needs to be made permanent in <a href="postconf.5.html">main.cf</a> or <a href="master.5.html">master.cf</a>. </p>
-<p> Based on this logging the system administrator can determine
-whether or not a backwards-compatible default setting needs to be
-made permanent in <a href="postconf.5.html">main.cf</a> or <a href="master.5.html">master.cf</a>. </p>
+<p> When no more backwards-compatible settings need to be made
+permanent, the administrator should turn off backwards compatibility
+by updating the <a href="postconf.5.html#compatibility_level">compatibility_level</a> setting in <a href="postconf.5.html">main.cf</a>. </p>
+
+<pre>
+# <b>postconf <a href="postconf.5.html#compatibility_level">compatibility_level</a>=1</b>
+# <b>postfix reload</b>
+</pre>
<p> Changes introduced with Postfix 2.12 (compatibility level 1):</p>
</ul>
-<p> When no more backwards-compatible settings need to be made
-permanent, the administrator should turn off the backwards-compatible
-default settings by updating the <a href="postconf.5.html#compatibility_level">compatibility_level</a> setting in
-<a href="postconf.5.html">main.cf</a>. </p>
-
-<pre>
-# <b>postconf <a href="postconf.5.html#compatibility_level">compatibility_level</a>=1</b>
-# <b>postfix reload</b>
-</pre>
-
-<p> Future incompatible changes will require setting "<a href="postconf.5.html#compatibility_level">compatibility_level</a>
-= 2", and so on. </p>
-
<p> This feature is available in Postfix 2.12 and later. </p>
<p>
Specify a list of names and/or name=value pairs, separated by
-whitespace or comma. The name=value form is supported with
-Postfix version 2.1 and later.
-</p>
+whitespace or comma. Specify "{ name=value }" to protect whitespace
+or comma in parameter values (whitespace after "{" and before "}"
+is ignored). The form name=value is supported with Postfix version
+2.1 and later; the use of {} is supported with Postfix 2.12 and
+later. </p>
<p>
Example:
</dl>
<p> Specify a list of names and/or name=value pairs, separated by
-whitespace or comma. The name=value form is supported with
-Postfix version 2.1 and later. </p>
+whitespace or comma. Specify "{ name=value }" to protect whitespace
+or comma in parameter values (whitespace after "{" and before "}"
+is ignored). The form name=value is supported with Postfix version
+2.1 and later; the use of {} is supported with Postfix 2.12 and
+later. </p>
</DD>
.sp
The \fBlocal\fR(8), \fBpipe\fR(8), \fBspawn\fR(8), and
\fBvirtual\fR(8) daemons require privileges.
-.IP "\fBChroot (default: Postfix >= 2.12: y, Postfix <2.12: n)\fR"
+.IP "\fBChroot (default: Postfix >= 2.12: n, Postfix <2.12: y)\fR"
Whether or not the service runs chrooted to the mail queue
directory (pathname is controlled by the \fBqueue_directory\fR
configuration variable in the main.cf file).
Run the daemon under control by the command specified with
the \fBdebugger_command\fR variable in the main.cf
configuration file. See DEBUG_README for hints and tips.
+.IP "\fB-o { \fIname\fR = \fIvalue\fB }\fR (long form, Postfix >= 2.12)"
.IP "\fB-o \fIname\fR=\fIvalue\fR (short form)"
-.IP "\fB-o { \fIname\fR = \fIvalue\fB }\fR (Postfix 2.12 and later)"
Override the named main.cf configuration parameter. The
parameter value can refer to other parameters as \fI$name\fR
etc., just like in main.cf. See \fBpostconf\fR(5) for
syntax.
.sp
-NOTE 1: with the "short form" shown above, do not specify
+NOTE 1: With the "long form" shown above, whitespace
+after "{" and before "}" is ignored.
+.sp
+NOTE 2: with the "short form" shown above, do not specify
whitespace around the "=" or in
parameter values. To specify a parameter value that contains
whitespace, use commas instead of spaces, or specify the
submission_mumble = text with whitespace...
.fi
.sp
-NOTE 2: Over-zealous use of parameter overrides makes the
+NOTE 3: Over-zealous use of parameter overrides makes the
Postfix configuration hard to understand and maintain. At
a certain point, it might be easier to configure multiple
instances of Postfix, instead of configuring multiple
options to make a Postfix daemon process increasingly verbose.
.IP "Other command-line arguments"
Specify "{" and "}" around command arguments that contain
-whitespace (Postfix 2.12 and later). Whitespace immediately
+whitespace (Postfix 2.12 and later). Whitespace
after "{" and before "}" is ignored.
.SH "SEE ALSO"
.na
The "{}" is required for "value1", optional for "value2". This form
is supported with Postfix versions >= 2.12.
.IP \(bu
-Instead of a parameter name, the first item inside "${...}" may be
-a logical expression of the form: "{value3} == {value4}" (equality)
-or "{value3} != {value4}" (inequality). This form is supported
-with Postfix versions >= 2.12.
+The first item inside "${...}" may be a logical expression of the
+form: "{value3} == {value4}". Besides the "==" (equality) operator
+Postfix supports "!=" (inequality), "<", "<=", ">=", and ">". The
+comparison is numerical when both operands are all digits, otherwise
+the comparison is lexicographical. These forms are supported with
+Postfix versions >= 2.12.
.IP \(bu
Each "value" is subject to recursive named parameter and logical
expression evaluation, except where noted.
main.cf and master.cf default settings after an upgrade to a newer
but incompatible Postfix version.
.PP
-While the backwards-compatible default settings are in effect,
-Postfix logs what services or what email would be affected by
-the incompatible change.
+While backwards compatibility is in effect, Postfix logs what
+services or what email would be affected by the incompatible change.
.PP
-Based on this logging the system administrator can determine
-whether or not a backwards-compatible default setting needs to be
-made permanent in main.cf or master.cf.
+As detailed below, based on this logging the system administrator
+can determine whether or not a backwards-compatible default setting
+needs to be made permanent in main.cf or master.cf.
+.PP
+When no more backwards-compatible settings need to be made
+permanent, the administrator should turn off backwards compatibility
+by updating the compatibility_level setting in main.cf.
+.PP
+.nf
+.na
+.ft C
+# \fBpostconf compatibility_level=1\fR
+# \fBpostfix reload\fR
+.fi
+.ad
+.ft R
.PP
Changes introduced with Postfix 2.12 (compatibility level 1):
.IP \(bu
.ft R
.br
.PP
-When no more backwards-compatible settings need to be made
-permanent, the administrator should turn off the backwards-compatible
-default settings by updating the compatibility_level setting in
-main.cf.
-.PP
-.nf
-.na
-.ft C
-# \fBpostconf compatibility_level=1\fR
-# \fBpostfix reload\fR
-.fi
-.ad
-.ft R
-.PP
-Future incompatible changes will require setting "compatibility_level
-= 2", and so on.
-.PP
This feature is available in Postfix 2.12 and later.
.SH config_directory (default: see "postconf -d" output)
The default location of the Postfix main.cf and master.cf
time keeping on System-V-ish systems.
.PP
Specify a list of names and/or name=value pairs, separated by
-whitespace or comma. The name=value form is supported with
-Postfix version 2.1 and later.
+whitespace or comma. Specify "{ name=value }" to protect whitespace
+or comma in parameter values (whitespace after "{" and before "}"
+is ignored). The form name=value is supported with Postfix version
+2.1 and later; the use of {} is supported with Postfix 2.12 and
+later.
.PP
Example:
.PP
.br
.PP
Specify a list of names and/or name=value pairs, separated by
-whitespace or comma. The name=value form is supported with
-Postfix version 2.1 and later.
+whitespace or comma. Specify "{ name=value }" to protect whitespace
+or comma in parameter values (whitespace after "{" and before "}"
+is ignored). The form name=value is supported with Postfix version
+2.1 and later; the use of {} is supported with Postfix 2.12 and
+later.
.SH in_flow_delay (default: 1s)
Time to pause before accepting a new message, when the message
arrival rate exceeds the message delivery rate. This feature is
shell meta characters by a shell command interpreter.
.sp
Specify "{" and "}" around command arguments that contain
-whitespace (Postfix 2.12 and later). Whitespace immediately
+whitespace (Postfix 2.12 and later). Whitespace
after "{" and before "}" is ignored.
.sp
In the command argument vector, the following macros are recognized
# .sp
# The \fBlocal\fR(8), \fBpipe\fR(8), \fBspawn\fR(8), and
# \fBvirtual\fR(8) daemons require privileges.
-# .IP "\fBChroot (default: Postfix >= 2.12: y, Postfix <2.12: n)\fR"
+# .IP "\fBChroot (default: Postfix >= 2.12: n, Postfix <2.12: y)\fR"
# Whether or not the service runs chrooted to the mail queue
# directory (pathname is controlled by the \fBqueue_directory\fR
# configuration variable in the main.cf file).
# Run the daemon under control by the command specified with
# the \fBdebugger_command\fR variable in the main.cf
# configuration file. See DEBUG_README for hints and tips.
+# .IP "\fB-o { \fIname\fR = \fIvalue\fB }\fR (long form, Postfix >= 2.12)"
# .IP "\fB-o \fIname\fR=\fIvalue\fR (short form)"
-# .IP "\fB-o { \fIname\fR = \fIvalue\fB }\fR (Postfix 2.12 and later)"
# Override the named main.cf configuration parameter. The
# parameter value can refer to other parameters as \fI$name\fR
# etc., just like in main.cf. See \fBpostconf\fR(5) for
# syntax.
# .sp
-# NOTE 1: with the "short form" shown above, do not specify
+# NOTE 1: With the "long form" shown above, whitespace
+# after "{" and before "}" is ignored.
+# .sp
+# NOTE 2: with the "short form" shown above, do not specify
# whitespace around the "=" or in
# parameter values. To specify a parameter value that contains
# whitespace, use commas instead of spaces, or specify the
# submission_mumble = text with whitespace...
# .fi
# .sp
-# NOTE 2: Over-zealous use of parameter overrides makes the
+# NOTE 3: Over-zealous use of parameter overrides makes the
# Postfix configuration hard to understand and maintain. At
# a certain point, it might be easier to configure multiple
# instances of Postfix, instead of configuring multiple
# options to make a Postfix daemon process increasingly verbose.
# .IP "Other command-line arguments"
# Specify "{" and "}" around command arguments that contain
-# whitespace (Postfix 2.12 and later). Whitespace immediately
+# whitespace (Postfix 2.12 and later). Whitespace
# after "{" and before "}" is ignored.
# SEE ALSO
# master(8), process manager
"value2". This form is supported with Postfix versions ≥ 2.12.
</p>
-<li> <p> Instead of a parameter name, the first item inside "${...}"
-may be a logical expression of the form: "{value3} == {value4}"
-(equality) or "{value3} != {value4}" (inequality). This form is
-supported with Postfix versions ≥ 2.12. </p>
+<li> <p> The first item inside "${...}" may be a logical expression
+of the form: "{value3} == {value4}". Besides the "==" (equality)
+operator Postfix supports "!=" (inequality), "<", "≤", "≥",
+and ">". The comparison is numerical when both operands are all
+digits, otherwise the comparison is lexicographical. These forms
+are supported with Postfix versions ≥ 2.12. </p>
<li> <p> Each "value" is subject to recursive named parameter and
logical expression evaluation, except where noted. </p>
The "{}" is required for "value1", optional for "value2". This form
is supported with Postfix versions >= 2.12.
.IP \(bu
-Instead of a parameter name, the first item inside "${...}" may be
-a logical expression of the form: "{value3} == {value4}" (equality)
-or "{value3} != {value4}" (inequality). This form is supported
-with Postfix versions >= 2.12.
+The first item inside "${...}" may be a logical expression of the
+form: "{value3} == {value4}". Besides the "==" (equality) operator
+Postfix supports "!=" (inequality), "<", "<=", ">=", and ">". The
+comparison is numerical when both operands are all digits, otherwise
+the comparison is lexicographical. These forms are supported with
+Postfix versions >= 2.12.
.IP \(bu
Each "value" is subject to recursive named parameter and logical
expression evaluation, except where noted.
<p>
Specify a list of names and/or name=value pairs, separated by
-whitespace or comma. The name=value form is supported with
-Postfix version 2.1 and later.
-</p>
+whitespace or comma. Specify "{ name=value }" to protect whitespace
+or comma in parameter values (whitespace after "{" and before "}"
+is ignored). The form name=value is supported with Postfix version
+2.1 and later; the use of {} is supported with Postfix 2.12 and
+later. </p>
<p>
Example:
</dl>
<p> Specify a list of names and/or name=value pairs, separated by
-whitespace or comma. The name=value form is supported with
-Postfix version 2.1 and later. </p>
+whitespace or comma. Specify "{ name=value }" to protect whitespace
+or comma in parameter values (whitespace after "{" and before "}"
+is ignored). The form name=value is supported with Postfix version
+2.1 and later; the use of {} is supported with Postfix 2.12 and
+later. </p>
%PARAM in_flow_delay 1s
main.cf and master.cf default settings after an upgrade to a newer
but incompatible Postfix version. </p>
-<p> While the backwards-compatible default settings are in effect,
-Postfix logs what services or what email would be affected by
-the incompatible change. </p>
+<p> While backwards compatibility is in effect, Postfix logs what
+services or what email would be affected by the incompatible change.
+</p>
+
+<p> As detailed below, based on this logging the system administrator
+can determine whether or not a backwards-compatible default setting
+needs to be made permanent in main.cf or master.cf. </p>
-<p> Based on this logging the system administrator can determine
-whether or not a backwards-compatible default setting needs to be
-made permanent in main.cf or master.cf. </p>
+<p> When no more backwards-compatible settings need to be made
+permanent, the administrator should turn off backwards compatibility
+by updating the compatibility_level setting in main.cf. </p>
+
+<pre>
+# <b>postconf compatibility_level=1</b>
+# <b>postfix reload</b>
+</pre>
<p> Changes introduced with Postfix 2.12 (compatibility level 1):</p>
</ul>
-<p> When no more backwards-compatible settings need to be made
-permanent, the administrator should turn off the backwards-compatible
-default settings by updating the compatibility_level setting in
-main.cf. </p>
-
-<pre>
-# <b>postconf compatibility_level=1</b>
-# <b>postfix reload</b>
-</pre>
-
-<p> Future incompatible changes will require setting "compatibility_level
-= 2", and so on. </p>
-
<p> This feature is available in Postfix 2.12 and later. </p>
smtp_reply_footer.c safe_ultostr.c verify_sender_addr.c \
dict_memcache.c mail_version.c memcache_proto.c server_acl.c \
mkmap_fail.c haproxy_srvr.c dsn_filter.c dynamicmaps.c uxtext.c \
- smtputf8.c mail_conf_over.c
+ smtputf8.c mail_conf_over.c mail_parm_split.c
OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \
canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \
clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \
smtp_reply_footer.o safe_ultostr.o verify_sender_addr.o \
dict_memcache.o mail_version.o memcache_proto.o server_acl.o \
mkmap_fail.o haproxy_srvr.o dsn_filter.o dynamicmaps.o uxtext.o \
- smtputf8.o attr_override.o $(NON_PLUGIN_MAP_OBJ)
+ smtputf8.o attr_override.o mail_parm_split.o $(NON_PLUGIN_MAP_OBJ)
# MAP_OBJ is for maps that may be dynamically loaded with dynamicmaps.cf.
# When hard-linking these maps, makedefs sets NON_PLUGIN_MAP_OBJ=$(MAP_OBJ),
# otherwise it sets the PLUGIN_* macros.
addr_match_list.h smtp_reply_footer.h safe_ultostr.h \
verify_sender_addr.h dict_memcache.h memcache_proto.h server_acl.h \
haproxy_srvr.h dsn_filter.h dynamicmaps.h uxtext.h smtputf8.h \
- attr_override.h
+ attr_override.h mail_parm_split.h
TESTSRC = rec2stream.c stream2rec.c recdump.c
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
verify_clnt xtext anvil_clnt scache ehlo_mask \
valid_mailhost_addr own_inet_addr header_body_checks \
data_redirect addr_match_list safe_ultostr verify_sender_addr \
- mail_version mail_dict server_acl uxtext
+ mail_version mail_dict server_acl uxtext mail_parm_split
LIBS = ../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX)
LIB_DIR = ../../lib
server_acl: server_acl.c $(LIB) $(LIBS)
$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
+mail_parm_split: mail_parm_split.c $(LIB) $(LIBS)
+ $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
+
tests: tok822_test mime_tests strip_addr_test tok822_limit_test \
xtext_test scache_multi_test ehlo_mask_test \
namadr_list_test mail_conf_time_test header_body_checks_tests \
mail_version_test server_acl_test resolve_local_test maps_test \
- safe_ultostr_test
+ safe_ultostr_test mail_parm_split_test
mime_tests: mime_test mime_nest mime_8bit mime_dom mime_trunc mime_cvt \
mime_cvt2 mime_cvt3 mime_garb1 mime_garb2 mime_garb3 mime_garb4
cmp header_body_checks_replace.ref header_body_checks_replace.tmp
rm -f header_body_checks_replace.tmp header_body_checks_head header_body_checks_mime header_body_checks_nest header_body_checks_body
+mail_parm_split_test: mail_parm_split mail_parm_split.in mail_parm_split.ref
+ $(SHLIB_ENV) ./mail_parm_split <mail_parm_split.in >mail_parm_split.tmp 2>&1
+ diff mail_parm_split.ref mail_parm_split.tmp
+ rm -f mail_parm_split.tmp
+
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck
dict_memcache.o: dict_memcache.h
dict_memcache.o: memcache_proto.h
dict_memcache.o: string_list.h
+dict_mysql.o: ../../include/argv.h
+dict_mysql.o: ../../include/dict.h
+dict_mysql.o: ../../include/events.h
+dict_mysql.o: ../../include/find_inet.h
+dict_mysql.o: ../../include/match_list.h
+dict_mysql.o: ../../include/msg.h
+dict_mysql.o: ../../include/myflock.h
+dict_mysql.o: ../../include/mymalloc.h
+dict_mysql.o: ../../include/myrand.h
+dict_mysql.o: ../../include/split_at.h
+dict_mysql.o: ../../include/stringops.h
dict_mysql.o: ../../include/sys_defs.h
+dict_mysql.o: ../../include/vbuf.h
+dict_mysql.o: ../../include/vstream.h
+dict_mysql.o: ../../include/vstring.h
+dict_mysql.o: cfg_parser.h
+dict_mysql.o: db_common.h
dict_mysql.o: dict_mysql.c
+dict_mysql.o: dict_mysql.h
+dict_mysql.o: string_list.h
dict_pgsql.o: ../../include/argv.h
dict_pgsql.o: ../../include/dict.h
dict_pgsql.o: ../../include/events.h
mail_params.o: own_inet_addr.h
mail_params.o: recipient_list.h
mail_params.o: verp_sender.h
+mail_parm_split.o: ../../include/argv.h
+mail_parm_split.o: ../../include/msg.h
+mail_parm_split.o: ../../include/mymalloc.h
+mail_parm_split.o: ../../include/stringops.h
+mail_parm_split.o: ../../include/sys_defs.h
+mail_parm_split.o: ../../include/vbuf.h
+mail_parm_split.o: ../../include/vstring.h
+mail_parm_split.o: mail_params.h
+mail_parm_split.o: mail_parm_split.c
+mail_parm_split.o: mail_parm_split.h
mail_pathname.o: ../../include/attr.h
mail_pathname.o: ../../include/iostuff.h
mail_pathname.o: ../../include/stringops.h
mail_stream.o: ../../include/warn_stat.h
mail_stream.o: cleanup_user.h
mail_stream.o: mail_params.h
+mail_stream.o: mail_parm_split.h
mail_stream.o: mail_proto.h
mail_stream.o: mail_queue.h
mail_stream.o: mail_stream.c
* Get the lookup tables and assignment targets.
*/
va_start(ap, parens);
- while ((idx = va_arg(ap, int)) != 0) {
+ while ((idx = va_arg(ap, int)) != ATTR_OVER_END) {
switch (idx) {
case ATTR_OVER_INT_TABLE:
if (int_table)
*/
/* { name = value } */
if (*nameval == parens[0]
- && (err = extpar(&nameval, parens, EXPAR_FLAG_NONE)) != 0)
+ && (err = extpar(&nameval, parens, EXTPAR_FLAG_NONE)) != 0)
msg_fatal("%s in \"%s\"", err, nameval);
if ((err = split_nameval(nameval, &key, &value)) != 0)
msg_fatal("malformed option: %s: \"...%s...\"", err, nameval);
* when the compatibility level changed for the first time, from 0 to 1.
*/
if (var_compat_level < 1) {
- /* Should inet_protocols also be listed here? */
if (mail_conf_lookup(VAR_APP_DOT_MYDOMAIN) == 0)
warn_compat_break_app_dot_mydomain = 1;
+
+ /*
+ * Not: #ifndef NO_EAI. They must configure SMTPUTF8_ENABLE=no if a
+ * warning message is logged, so that they don't suddenly start to
+ * lose mail after Postfix is built with EAI support.
+ */
if (mail_conf_lookup(VAR_SMTPUTF8_ENABLE) == 0)
warn_compat_break_smtputf8_enable = 1;
warn_compat_break_chroot = 1;
--- /dev/null
+/*++
+/* NAME
+/* mail_parm_split 3
+/* SUMMARY
+/* split parameter list value
+/* SYNOPSIS
+/* #include <mail_parm_split.h>
+/*
+/* ARGV *mail_parm_split(
+/* cost char *name,
+/* const char *value)
+/* DESCRIPTION
+/* mail_parm_split() splits a parameter list value into its
+/* elements, and extracts text from inside {}. It uses
+/* CHARS_COMMA_SP as list element delimiters, and CHARS_BRACE
+/* for grouping.
+/*
+/* Arguments:
+/* .IP name
+/* Parameter name. This is used to privode context for
+/* error messages.
+/* .IP value
+/* Parameter value.
+/* DIAGNOSTICS
+/* fatal: syntax error while extracting text from {}.
+/* SEE ALSO
+/* argv_splitq(3), string array utilities
+/* extpar(3), extract text from parentheses
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+ /*
+ * System library.
+ */
+#include <sys_defs.h>
+
+ /*
+ * Utility library.
+ */
+#include <msg.h>
+#include <mymalloc.h>
+#include <stringops.h>
+
+ /*
+ * Global library.
+ */
+#include <mail_params.h>
+#include <mail_parm_split.h>
+
+ /*
+ * While testing, do not terminate the program after a syntax error.
+ */
+#ifdef TEST
+#undef msg_fatal
+#define msg_fatal msg_warn
+#endif
+
+/* mail_parm_split - split list, extract {text}, errors are fatal */
+
+ARGV *mail_parm_split(const char *name, const char *value)
+{
+ ARGV *argvp = argv_alloc(1);
+ char *saved_string = mystrdup(value);
+ char *bp = saved_string;
+ char *arg;
+ const char *err;
+
+ /*
+ * The code that detects the error shall either signal or handle the
+ * error. In this case, mystrtokq() detects no error, extpar() signals
+ * the error to its caller, and this function handles the error.
+ */
+ while ((arg = mystrtokq(&bp, CHARS_COMMA_SP, CHARS_BRACE)) != 0) {
+ if (*arg == CHARS_BRACE[0]
+ && (err = extpar(&arg, CHARS_BRACE, EXTPAR_FLAG_STRIP)) != 0)
+ msg_fatal("%s: %s", name, err);
+ argv_add(argvp, arg, (char *) 0);
+ }
+ argv_terminate(argvp);
+ myfree(saved_string);
+ return (argvp);
+}
+
+#ifdef TEST
+
+ /*
+ * This function is security-critical so it better have a unit-test driver.
+ */
+#include <string.h>
+#include <vstream.h>
+#include <vstream.h>
+#include <vstring_vstream.h>
+
+int main(void)
+{
+ VSTRING *vp = vstring_alloc(100);
+ ARGV *argv;
+ char *start;
+ char *str;
+ char **cpp;
+
+ while (vstring_fgets_nonl(vp, VSTREAM_IN) && VSTRING_LEN(vp) > 0) {
+ start = vstring_str(vp);
+ vstream_printf("Input:\t>%s<\n", start);
+ vstream_fflush(VSTREAM_OUT);
+ argv = mail_parm_split("stdin", start);
+ for (cpp = argv->argv; (str = *cpp) != 0; cpp++)
+ vstream_printf("Output:\t>%s<\n", str);
+ argv_free(argv);
+ vstream_fflush(VSTREAM_OUT);
+ }
+ return (0);
+}
+
+#endif
--- /dev/null
+#ifndef _MAIL_PARM_SPLIT_H_INCLUDED_
+#define _MAIL_PARM_SPLIT_H_INCLUDED_
+
+/*++
+/* NAME
+/* mail_parm_split 3h
+/* SUMMARY
+/* split parameter list value
+/* SYNOPSIS
+/* #include <mail_parm_split.h>
+/* DESCRIPTION
+/* .nf
+
+#endif
+
+ /*
+ * Utility library.
+ */
+#include <argv.h>
+
+ /*
+ * External interface. For consistency, the separator and grouping character
+ * sets are not passed as parameters.
+ */
+extern ARGV *mail_parm_split(const char *, const char *);
+
+#define MAIL_PARM_FLAG_NONE 0
+#define MAIL_PARM_FLAG_EXTRACT (1<<0)
+#define MAIL_PARM_FLAG_ALL (1<<0)
+
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+#endif
--- /dev/null
+TZ PATH=/bin:/usr/bin XAUTHORITY
+TZ { LESS=-m -C -s -f -e } XAUTHORITY
+{ LESS=-m -C -s -f -e } TZ XAUTHORITY
+TZ XAUTHORITY { LESS=-m -C -s -f -e }
+TZ { LESS=-m -C -s -f -e XAUTHORITY
+TZ { LESS=-m -C -s -f -e }x XAUTHORITY
--- /dev/null
+Input: >TZ PATH=/bin:/usr/bin XAUTHORITY<
+Output: >TZ<
+Output: >PATH=/bin:/usr/bin<
+Output: >XAUTHORITY<
+Input: >TZ { LESS=-m -C -s -f -e } XAUTHORITY<
+Output: >TZ<
+Output: >LESS=-m -C -s -f -e<
+Output: >XAUTHORITY<
+Input: >{ LESS=-m -C -s -f -e } TZ XAUTHORITY<
+Output: >LESS=-m -C -s -f -e<
+Output: >TZ<
+Output: >XAUTHORITY<
+Input: >TZ XAUTHORITY { LESS=-m -C -s -f -e }<
+Output: >TZ<
+Output: >XAUTHORITY<
+Output: >LESS=-m -C -s -f -e<
+Input: >TZ { LESS=-m -C -s -f -e XAUTHORITY<
+unknown: warning: stdin: missing '}' in "{ LESS=-m -C -s -f -e XAUTHORITY"
+Output: >TZ<
+Output: >LESS=-m -C -s -f -e XAUTHORITY<
+Input: >TZ { LESS=-m -C -s -f -e }x XAUTHORITY<
+unknown: warning: stdin: syntax error after '}' in "{ LESS=-m -C -s -f -e }x"
+Output: >TZ<
+Output: >LESS=-m -C -s -f -e<
+Output: >XAUTHORITY<
#include <opened.h>
#include <mail_params.h>
#include <mail_stream.h>
+#include <mail_parm_split.h>
/* Application-specific. */
* talking a Postfix-internal protocol there is no way we can tell what
* is being executed except by duplicating a lot of existing code.
*/
- export_env = argv_split(var_export_environ, ", \t\r\n");
+ export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ);
while ((stream = vstream_popen(O_RDWR,
VSTREAM_POPEN_COMMAND, command,
VSTREAM_POPEN_EXPORT, export_env->argv,
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20141002"
+#define MAIL_RELEASE_DATE "20141005"
#define MAIL_VERSION_NUMBER "2.12"
#ifdef SNAPSHOT
command.o: ../../include/mac_parse.h
command.o: ../../include/mail_copy.h
command.o: ../../include/mail_params.h
+command.o: ../../include/mail_parm_split.h
command.o: ../../include/maps.h
command.o: ../../include/mbox_conf.h
command.o: ../../include/msg.h
command.o: ../../include/recipient_list.h
command.o: ../../include/resolve_clnt.h
command.o: ../../include/sent.h
+command.o: ../../include/stringops.h
command.o: ../../include/sys_defs.h
command.o: ../../include/tok822.h
command.o: ../../include/vbuf.h
#include <pipe_command.h>
#include <mail_copy.h>
#include <dsn_util.h>
+#include <mail_parm_split.h>
/* Application-specific. */
* Evaluate the command execution directory. Defer delivery if expansion
* fails.
*/
- export_env = argv_split(var_export_environ, ", \t\r\n");
+ export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ);
exec_dir = vstring_alloc(10);
expand_status = local_expand(exec_dir, var_exec_directory,
&state, &usr_attr, var_exec_exp_filter);
master.o: ../../include/iostuff.h
master.o: ../../include/mail_conf.h
master.o: ../../include/mail_params.h
+master.o: ../../include/mail_parm_split.h
master.o: ../../include/mail_task.h
master.o: ../../include/mail_version.h
master.o: ../../include/msg.h
#include <mail_conf.h>
#include <open_lock.h>
#include <inet_proto.h>
+#include <mail_parm_split.h>
/* Application-specific. */
* Environment import filter, to enforce consistent behavior whether
* Postfix is started by hand, or at system boot time.
*/
- import_env = argv_split(var_import_environ, ", \t\r\n");
+ import_env = mail_parm_split(VAR_IMPORT_ENVIRON, var_import_environ);
clean_env(import_env->argv);
argv_free(import_env);
vstring_str(vstring_sprintf(junk, "%d", serv->listen_fd_count)),
(char *) 0);
while ((cp = mystrtokq(&bufp, master_blanks, "{}")) != 0) {
- if (*cp == '{' && (err = extpar(&cp, "{}", EXPAR_FLAG_STRIP)) != 0)
+ if (*cp == '{' && (err = extpar(&cp, "{}", EXTPAR_FLAG_STRIP)) != 0)
msg_fatal("%s: line %d: %s",
VSTREAM_PATH(master_fp), master_line, err);
argv_add(serv->args, cp, (char *) 0);
my_def_action = def_action;
if (name[0] == '{') { /* } */
op = name;
- if ((err = extpar(&op, parens, EXPAR_FLAG_NONE)) != 0)
+ if ((err = extpar(&op, parens, EXTPAR_FLAG_NONE)) != 0)
msg_fatal("milter service syntax error: %s", err);
if ((name = mystrtok(&op, sep)) == 0)
msg_fatal("empty milter definition: \"%s\"", names);
pipe.o: ../../include/mail_conf.h
pipe.o: ../../include/mail_copy.h
pipe.o: ../../include/mail_params.h
+pipe.o: ../../include/mail_parm_split.h
pipe.o: ../../include/mail_server.h
pipe.o: ../../include/mail_version.h
pipe.o: ../../include/msg.h
/* shell meta characters by a shell command interpreter.
/* .sp
/* Specify "{" and "}" around command arguments that contain
-/* whitespace (Postfix 2.12 and later). Whitespace immediately
+/* whitespace (Postfix 2.12 and later). Whitespace
/* after "{" and before "}" is ignored.
/* .sp
/* In the command argument vector, the following macros are recognized
#include <sys_exits.h>
#include <delivered_hdr.h>
#include <fold_addr.h>
+#include <mail_parm_split.h>
/* Single server skeleton. */
DELIVER_MSG_CLEANUP();
return (deliver_status);
}
- export_env = argv_split(var_export_environ, ", \t\r\n");
+ export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ);
command_status = pipe_command(request->fp, why,
PIPE_CMD_UID, attr.uid,
*/
if (prefix != 0 && *prefix != '/' && *prefix != '.') {
if (*prefix == '{') { /* } */
- if ((err = extpar(&prefix, "{}", EXPAR_FLAG_NONE)) != 0) {
+ if ((err = extpar(&prefix, "{}", EXTPAR_FLAG_NONE)) != 0) {
/* XXX Encapsulate this in pcf_warn() function. */
if (local_scope)
msg_warn("%s:%s: %s",
char *arg = argv->argv[field];
char *err;
- if ((err = extpar(&arg, parens, EXPAR_FLAG_STRIP)) != 0) {
+ if ((err = extpar(&arg, parens, EXTPAR_FLAG_STRIP)) != 0) {
msg_warn("%s: %s", MASTER_CONF_FILE, err);
myfree(err);
}
postdrop.o: ../../include/mail_conf.h
postdrop.o: ../../include/mail_dict.h
postdrop.o: ../../include/mail_params.h
+postdrop.o: ../../include/mail_parm_split.h
postdrop.o: ../../include/mail_proto.h
postdrop.o: ../../include/mail_queue.h
postdrop.o: ../../include/mail_stream.h
#include <mail_dict.h>
#include <user_acl.h>
#include <rec_attr_map.h>
+#include <mail_parm_split.h>
/* Application-specific. */
* This program is installed with setgid privileges. Strip the process
* environment so that we don't have to trust the C library.
*/
- import_env = argv_split(var_import_environ, ", \t\r\n");
+ import_env = mail_parm_split(VAR_IMPORT_ENVIRON, var_import_environ);
clean_env(import_env->argv);
argv_free(import_env);
postfix.o: ../../include/clean_env.h
postfix.o: ../../include/mail_conf.h
postfix.o: ../../include/mail_params.h
+postfix.o: ../../include/mail_parm_split.h
postfix.o: ../../include/mail_version.h
postfix.o: ../../include/msg.h
postfix.o: ../../include/msg_syslog.h
#include <mail_conf.h>
#include <mail_params.h>
#include <mail_version.h>
+#include <mail_parm_split.h>
/* Additional installation parameters. */
* because some shell scripts use environment settings to override
* main.cf settings.
*/
- import_env = argv_split(var_import_environ, ", \t\r\n");
+ import_env = mail_parm_split(VAR_IMPORT_ENVIRON, var_import_environ);
clean_env(import_env->argv);
argv_free(import_env);
postmulti.o: ../../include/htable.h
postmulti.o: ../../include/mail_conf.h
postmulti.o: ../../include/mail_params.h
+postmulti.o: ../../include/mail_parm_split.h
postmulti.o: ../../include/mail_version.h
postmulti.o: ../../include/msg.h
postmulti.o: ../../include/msg_syslog.h
#include <mail_version.h>
#include <mail_params.h>
#include <mail_conf.h>
+#include <mail_parm_split.h>
/* Application-specific. */
* because some shell scripts use environment settings to override
* main.cf settings.
*/
- import_env = argv_split(var_import_environ, ", \t\r\n");
+ import_env = mail_parm_split(VAR_IMPORT_ENVIRON, var_import_environ);
clean_env(import_env->argv);
argv_free(import_env);
postqueue.o: ../../include/mail_dict.h
postqueue.o: ../../include/mail_flush.h
postqueue.o: ../../include/mail_params.h
+postqueue.o: ../../include/mail_parm_split.h
postqueue.o: ../../include/mail_proto.h
postqueue.o: ../../include/mail_queue.h
postqueue.o: ../../include/mail_run.h
postqueue.o: ../../include/mymalloc.h
postqueue.o: ../../include/safe.h
postqueue.o: ../../include/smtp_stream.h
+postqueue.o: ../../include/stringops.h
postqueue.o: ../../include/sys_defs.h
postqueue.o: ../../include/user_acl.h
postqueue.o: ../../include/valid_hostname.h
#include <user_acl.h>
#include <valid_mailhost_addr.h>
#include <mail_dict.h>
+#include <mail_parm_split.h>
/* Application-specific. */
* directory info when the mail system is down.
*/
if (geteuid() != 0) {
- import_env = argv_split(var_import_environ, ", \t\r\n");
+ import_env = mail_parm_split(VAR_IMPORT_ENVIRON, var_import_environ);
clean_env(import_env->argv);
argv_free(import_env);
}
"send unicode address");
return (-1);
}
+
+ /*
+ * Not: #ifndef NO_EAI. They must configure SMTPUTF8_ENABLE=no if a
+ * warning message is logged, so that they don't suddenly start to
+ * lose mail after Postfix is built with EAI support.
+ */
if (warn_compat_break_smtputf8_enable)
- msg_info("using backwards-compatible default setting "
+ msg_info("using backwards-compatible default setting "
VAR_SMTPUTF8_ENABLE "=no to accept non-ASCII sender "
- "address \"%s\" from %s (" VAR_COMPAT_LEVEL "<1)",
+ "address \"%s\" from %s (" VAR_COMPAT_LEVEL "<1)",
STR(state->addr_buf), state->namaddr);
}
"send unicode address");
return (-1);
}
+
+ /*
+ * Not: #ifndef NO_EAI. They must configure SMTPUTF8_ENABLE=no if a
+ * warning message is logged, so that they don't suddenly start to
+ * lose mail after Postfix is built with EAI support.
+ */
if (warn_compat_break_smtputf8_enable)
- msg_info("using backwards-compatible default setting "
+ msg_info("using backwards-compatible default setting "
VAR_SMTPUTF8_ENABLE "=no to accept non-ASCII recipient "
- "address \"%s\" from %s (" VAR_COMPAT_LEVEL "<1)",
+ "address \"%s\" from %s (" VAR_COMPAT_LEVEL "<1)",
STR(state->addr_buf), state->namaddr);
}
if (SMTPD_STAND_ALONE(state) == 0) {
if (*name == '{') { /* } */
cp = saved_name = mystrdup(name);
- if ((err = extpar(&cp, parens, EXPAR_FLAG_NONE)) != 0)
+ if ((err = extpar(&cp, parens, EXTPAR_FLAG_NONE)) != 0)
msg_fatal("policy service syntax error: %s", cp);
if ((policy_name = mystrtok(&cp, sep)) == 0)
msg_fatal("empty policy service: \"%s\"", name);
spawn.o: ../../include/dict.h
spawn.o: ../../include/mail_conf.h
spawn.o: ../../include/mail_params.h
+spawn.o: ../../include/mail_parm_split.h
spawn.o: ../../include/mail_server.h
spawn.o: ../../include/mail_version.h
spawn.o: ../../include/msg.h
spawn.o: ../../include/set_eugid.h
spawn.o: ../../include/spawn_command.h
spawn.o: ../../include/split_at.h
+spawn.o: ../../include/stringops.h
spawn.o: ../../include/sys_defs.h
spawn.o: ../../include/timed_wait.h
spawn.o: ../../include/vbuf.h
#include <mail_params.h>
#include <mail_server.h>
#include <mail_conf.h>
+#include <mail_parm_split.h>
/* Application-specific. */
/*
* Execute the command.
*/
- export_env = argv_split(var_export_environ, ", \t\r\n");
+ export_env = mail_parm_split(VAR_EXPORT_ENVIRON, var_export_environ);
status = spawn_command(SPAWN_CMD_STDIN, vstream_fileno(client_stream),
SPAWN_CMD_STDOUT, vstream_fileno(client_stream),
SPAWN_CMD_STDERR, vstream_fileno(client_stream),
dict_test: dict_open testdb dict_test.in dict_test.ref
rm -f testdb.db testdb.dir testdb.pag
$(SHLIB_ENV) ../postmap/postmap -N hash:testdb
- $(SHLIB_ENV) ./dict_open hash:testdb write < dict_test.in > dict_test.tmp 2>&1
+ $(SHLIB_ENV) ./dict_open hash:testdb write < dict_test.in 2>&1 | sed 's/uid=[0-9][0-9][0-9]*/uid=USER/' >dict_test.tmp
diff dict_test.ref dict_test.tmp
$(SHLIB_ENV) ../postmap/postmap -n hash:testdb
- $(SHLIB_ENV) ./dict_open hash:testdb write < dict_test.in > dict_test.tmp 2>&1
+ $(SHLIB_ENV) ./dict_open hash:testdb write < dict_test.in 2>&1 | sed 's/uid=[0-9][0-9][0-9]*/uid=USER/' >dict_test.tmp
diff dict_test.ref dict_test.tmp
rm -f testdb.db testdb.dir testdb.pag dict_test.tmp
dict_pcre_test: dict_open dict_pcre.in dict_pcre.map dict_pcre.ref
- $(SHLIB_ENV) ./dict_open pcre:dict_pcre.map read <dict_pcre.in >dict_pcre.tmp 2>&1
+ $(SHLIB_ENV) ./dict_open pcre:dict_pcre.map read <dict_pcre.in 2>&1 | sed 's/uid=[0-9][0-9][0-9]*/uid=USER/' >dict_pcre.tmp
diff dict_pcre.ref dict_pcre.tmp
rm -f dict_pcre.tmp
dict_regexp_test: dict_open dict_regexp.in dict_regexp.map dict_regexp.ref
- $(SHLIB_ENV) ./dict_open regexp:dict_regexp.map read <dict_regexp.in >dict_regexp.tmp 2>&1
+ $(SHLIB_ENV) ./dict_open regexp:dict_regexp.map read <dict_regexp.in | sed 's/uid=[0-9][0-9][0-9]*/uid=USER/' >dict_regexp.tmp
diff dict_regexp.ref dict_regexp.tmp
rm -f dict_regexp.tmp
dict_cidr_test: dict_open dict_cidr.in dict_cidr.map dict_cidr.ref
- $(SHLIB_ENV) ./dict_open cidr:dict_cidr.map read <dict_cidr.in >dict_cidr.tmp 2>&1
+ $(SHLIB_ENV) ./dict_open cidr:dict_cidr.map read <dict_cidr.in 2>&1 | sed 's/uid=[0-9][0-9][0-9]*/uid=USER/' >dict_cidr.tmp
diff dict_cidr.ref dict_cidr.tmp
rm -f dict_cidr.tmp
dict_seq_test: dict_open testdb dict_seq.in dict_seq.ref
rm -f testdb.db testdb.dir testdb.pag
- $(SHLIB_ENV) ./dict_open hash:testdb create sync < dict_seq.in > dict_seq.tmp 2>&1
+ $(SHLIB_ENV) ./dict_open hash:testdb create sync < dict_seq.in 2>&1 | sed 's/uid=[0-9][0-9][0-9]*/uid=USER/' > dict_seq.tmp
diff dict_seq.ref dict_seq.tmp
rm -f testdb.db testdb.dir testdb.pag dict_seq.tmp
exec_command.o: msg.h
exec_command.o: sys_defs.h
extpar.o: extpar.c
+extpar.o: msg.h
extpar.o: stringops.h
extpar.o: sys_defs.h
extpar.o: vbuf.h
load_file.o: vstream.h
load_file.o: warn_stat.h
load_lib.o: load_lib.c
-load_lib.o: load_lib.h
-load_lib.o: msg.h
load_lib.o: sys_defs.h
lowercase.o: lowercase.c
lowercase.o: stringops.h
./dict_open: warning: cidr map dict_cidr.map, line 16: missing ']' character after "[1234": skipping this rule
./dict_open: warning: cidr map dict_cidr.map, line 17: garbage after "[1234]": skipping this rule
./dict_open: warning: cidr map dict_cidr.map, line 18: bad net/mask pattern: "172.16.1.3/3x": skipping this rule
+owner=untrusted (uid=USER)
> get 172.16.0.0
172.16.0.0=554 match bad netblock 172.16.0.0/21
> get 172.16.0.1
./dict_open: warning: pcre map dict_pcre.map, line 10: out of range replacement index "5": skipping this rule
./dict_open: warning: pcre map dict_pcre.map, line 17: $number found in negative match replacement text: skipping this rule
./dict_open: warning: pcre map dict_pcre.map, line 22: no regexp: skipping this rule
+owner=untrusted (uid=USER)
> get true
true: not found
> get true1
+owner=untrusted (uid=USER)
> del bar
bar: deleted
> get bar
/* .IP parens
/* One matching pair of parentheses, opening parenthesis first.
/* .IP flags
-/* EXPAR_FLAG_NONE, or the bitwise OR of one or more flags:
+/* EXTPAR_FLAG_NONE, or the bitwise OR of one or more flags:
/* .RS
-/* .IP EXPAR_FLAG_STRIP
+/* .IP EXTPAR_FLAG_EXTRACT
+/* This flag is intended to instruct expar() callers that
+/* expar() should be invoked. It has no effect on expar()
+/* itself.
+/* .IP EXTPAR_FLAG_STRIP
/* Skip whitespace after the opening parenthesis, and trim
/* whitespace before the closing parenthesis.
/* .RE
/* be destroyed with myfree(). The following decribes the errors
/* and the state of the buffer and buffer pointer.
/* .IP "missing closing parenthesis"
-/* The buffer pointer points to text as if the closing parenthesis
-/* were present.
+/* The buffer pointer points to text as if a closing parenthesis
+/* were present at the end of the input.
/* .IP "text after closing parenthesis"
/* The buffer pointer points to text as if the offending text
/* were not present.
/* extpar - extract text from parentheses */
-char *extpar(char **bp, const char *parens, int strip)
+char *extpar(char **bp, const char *parens, int flags)
{
char *cp = *bp;
char *err = 0;
cp += 1;
cp[len -= 2] = 0;
}
- if (strip) {
+ if (flags & EXTPAR_FLAG_STRIP) {
trimblanks(cp, len)[0] = 0;
while (ISSPACE(*cp))
cp++;
/* named attribute expansion and logical expression evaluation.
/* Whitespace before or after {text1} or {text2} is ignored.
/* .IP "${{text1} == ${text2} ? {text3} : {text4}}"
-/* .IP "${{text1} != ${text2} ? {text3} : {text4}}"
/* Logical expression-based substition. First, the content
/* of {text1} and ${text2} is subjected to named attribute and
/* logical expression-based substitution. Next, the logical
/* expression is evaluated. If it evaluates to "true", the
/* result is the content of {text3}, otherwise it is the content
/* of {text4}, after named attribute and logical expression-based
-/* substitution.
+/* substitution. In addition to ==, this supports !=, <, <=,
+/* >=, and >. Comparisons are numerical when both operands are
+/* all digits, otherwise the comparisons are lexicographical.
/*
/* Arguments:
/* .IP result
#define MAC_EXP_BVAL_FALSE ""
/*
- * Relational operator. For now, we test only for (in)equality.
+ * Relational operators.
*/
#define MAC_EXP_OP_STR_EQ "=="
#define MAC_EXP_OP_STR_NE "!="
extern size_t balpar(const char *, const char *);
extern char *extpar(char **, const char *, int);
-#define EXPAR_FLAG_NONE (0)
-#define EXPAR_FLAG_STRIP (1<<0)
+#define EXTPAR_FLAG_NONE (0)
+#define EXTPAR_FLAG_STRIP (1<<0) /* "{ text }" -> "text" */
+#define EXTPAR_FLAG_EXTRACT (1<<1) /* hint from caller's caller */
+
+ /*
+ * Character sets for parsing.
+ */
+#define CHARS_COMMA_SP ", \t\r\n" /* list separator */
+#define CHARS_SPACE " \t\r\n" /* word separator */
+#define CHARS_BRACE "{}" /* grouping */
/* LICENSE
/* .ad
./dict_open: error: cidr:/xx map requires O_RDONLY access mode
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: cidr:/xx is unavailable. cidr:/xx map requires O_RDONLY access mode
foo: error
./dict_open: error: open /xx: No such file or directory
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: cidr:/xx is unavailable. open /xx: No such file or directory
foo: error
./dict_open: error: pcre:/xx map requires O_RDONLY access mode
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: pcre:/xx is unavailable. pcre:/xx map requires O_RDONLY access mode
foo: error
./dict_open: error: open /xx: No such file or directory
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: pcre:/xx is unavailable. open /xx: No such file or directory
foo: error
./dict_open: error: regexp:/xx map requires O_RDONLY access mode
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: regexp:/xx is unavailable. regexp:/xx map requires O_RDONLY access mode
foo: error
./dict_open: error: open /xx: No such file or directory
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: regexp:/xx is unavailable. open /xx: No such file or directory
foo: error
./dict_open: error: unix:xx map requires O_RDONLY access mode
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: unix:xx is unavailable. unix:xx map requires O_RDONLY access mode
foo: error
./dict_open: error: unknown table: unix:xx
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: unix:xx is unavailable. unknown table: unix:xx
foo: error
./dict_open: error: texthash:/xx map requires O_RDONLY access mode
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: texthash:/xx is unavailable. texthash:/xx map requires O_RDONLY access mode
foo: error
./dict_open: error: open database /xx: No such file or directory
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: texthash:/xx is unavailable. open database /xx: No such file or directory
foo: error
./dict_open: error: open database /xx.db: No such file or directory
+owner=trusted (uid=-1)
> get foo
./dict_open: warning: hash:/xx is unavailable. open database /xx.db: No such file or directory
foo: error