diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-03-02 18:33:23 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-03-02 18:47:28 +0200 |
commit | c767932556198cb064e7552bea14cc3563a114d0 (patch) | |
tree | 15e1ff9d07c07ab3e4a7308804f12ce700c2d7db | |
parent | 801656d6ae9b6c5cb199b2e53001ecaac41db4ae (diff) | |
download | pies-c767932556198cb064e7552bea14cc3563a114d0.tar.gz pies-c767932556198cb064e7552bea14cc3563a114d0.tar.bz2 |
Bugfixes
* src/comp.c (component_verify): Fix stdout redirection check.
* src/meta1parse.c (meta1_translate_node): Skip simple statements.
(meta1_translate_node): Allocate comp->dir
* doc/pies.texi: Use @example instead of @smallexample
-rw-r--r-- | doc/pies.texi | 290 | ||||
-rw-r--r-- | src/comp.c | 18 | ||||
-rw-r--r-- | src/meta1parse.c | 6 |
3 files changed, 183 insertions, 131 deletions
diff --git a/doc/pies.texi b/doc/pies.texi index 51eac43..13deec0 100644 --- a/doc/pies.texi +++ b/doc/pies.texi @@ -1,3 +1,2 @@ \input texinfo @c -*-texinfo-*- -@smallbook @c %**start of header @@ -253,5 +252,5 @@ this format, the program also understands configuration files in -@smallexample +@example pies --config-file @var{filename} -@end smallexample +@end example @@ -288,3 +287,3 @@ in a single command line, e.g.: -@smallexample +@example @group @@ -294,3 +293,3 @@ pies --config-file /etc/pies.conf \ @end group -@end smallexample +@end example @@ -323,6 +322,7 @@ line option. * Component Statement:: -* Notification:: Mail Notification -* ACL:: Access Control Lists -* inetd:: Using @command{inetd} Configuration Files -* include-meta1:: Using @command{meta1} Configuration Files +* Notification:: Mail Notification. +* ACL:: Access Control Lists. +* control:: The @samp{control} statement. +* inetd:: Using @command{inetd} Configuration Files. +* include-meta1:: Using @command{meta1} Configuration Files. * Global Configuration:: @@ -357,6 +357,6 @@ with @samp{#} or @samp{//} and continue to the end of the line: -@smallexample +@example # This is a comment // This too is a comment -@end smallexample +@end example @@ -386,3 +386,3 @@ with a semicolon (@samp{;}). -@smallexample +@example pidfile /var/run/pies.pid; @@ -390,3 +390,3 @@ source-info yes; debug 10; -@end smallexample +@end example @@ -444,3 +444,3 @@ physical lines, e.g.: -@smallexample +@example @group @@ -449,3 +449,3 @@ physical lines, e.g.: @end group -@end smallexample +@end example @@ -459,3 +459,3 @@ example above: -@smallexample +@example @group @@ -464,3 +464,3 @@ example above: @end group -@end smallexample +@end example @@ -477,3 +477,3 @@ together into a single string. For example: -@smallexample +@example @group @@ -484,3 +484,3 @@ EOT @end group -@end smallexample +@end example @@ -497,3 +497,3 @@ here-documents in a natural fashion. For example: -@smallexample +@example @group @@ -504,3 +504,3 @@ TEXT @end group -@end smallexample +@end example @@ -512,3 +512,3 @@ delimiter, as in: -@smallexample +@example help-text <<-EOT @@ -516,3 +516,3 @@ help-text <<-EOT EOT; -@end smallexample +@end example @@ -524,5 +524,5 @@ whose value is a list of strings: -@smallexample +@example dependents (pmult, auth); -@end smallexample +@end example @@ -542,3 +542,3 @@ the example below: -@smallexample +@example @group @@ -548,3 +548,3 @@ component multiplexor @{ @end group -@end smallexample +@end example @@ -686,3 +686,3 @@ compatibility with the @sc{c} preprocessor. -@smallexample +@example component @var{tag} @{ @@ -690,3 +690,3 @@ component @var{tag} @{ @} -@end smallexample +@end example @@ -962,5 +962,5 @@ For example: -@smallexample +@example limits T10 R20 U16 P20 -@end smallexample +@end example @@ -1007,5 +1007,5 @@ environment variables like @env{PATH}, e.g.: -@smallexample +@example PATH+=:/sbin -@end smallexample +@end example @@ -1063,3 +1063,3 @@ to the log file. This behavior can be modified using @deffn {Config: component} return-code -@smallexample +@example return-code @var{codes} @{ @@ -1067,3 +1067,3 @@ return-code @var{codes} @{ @} -@end smallexample +@end example @end deffn @@ -1183,5 +1183,5 @@ the file. For example: -@smallexample +@example stderr file /var/log/component/name.err; -@end smallexample +@end example @@ -1197,5 +1197,5 @@ Example: -@smallexample +@example stderr syslog err; -@end smallexample +@end example @end table @@ -1257,6 +1257,6 @@ For example: -@smallexample +@example socket "unix:///var/run/socket;user=nobody;group=mail;mode=770"; -@end smallexample +@end example @@ -1384,3 +1384,3 @@ TCP-based echo service: -@smallexample +@example @group @@ -1392,3 +1392,3 @@ component echo @{ @end group -@end smallexample +@end example @@ -1396,5 +1396,5 @@ component echo @{ -@smallexample +@example echo stream tcp nowait root internal -@end smallexample +@end example @@ -1448,3 +1448,3 @@ e.g.: -@smallexample +@example component tcpmux-master @{ @@ -1454,3 +1454,3 @@ component tcpmux-master @{ @} -@end smallexample +@end example @@ -1490,3 +1490,3 @@ The command line for handling this service. -@smallexample +@example component scp-to @{ @@ -1497,3 +1497,3 @@ component scp-to @{ @} -@end smallexample +@end example @@ -1565,3 +1565,3 @@ and ensures that a special program is invoked after closing each -@smallexample +@example component ftp @{ @@ -1576,3 +1576,3 @@ component ftp @{ @} -@end smallexample +@end example @@ -1604,3 +1604,3 @@ statement, a reference to its detailed description is provided. -@smallexample +@example component @var{tag} @{ @@ -1746,3 +1746,3 @@ component @var{tag} @{ @} -@end smallexample +@end example @@ -1763,5 +1763,5 @@ latter is a comma-separated list of email addresses, e.g.: -@smallexample +@example notify "root@@localhost,postmaster@@localhost"; -@end smallexample +@end example @end deffn @@ -1778,5 +1778,5 @@ are referenced using the following construct: -@smallexample +@example $@{@var{name}@} -@end smallexample +@end example @@ -1791,5 +1791,5 @@ Supposing that @samp{component} is @samp{ftpd} and @samp{retcode} is -@smallexample +@example Subject: $@{component@} exited with code $@{retcode@} -@end smallexample +@end example @@ -1798,5 +1798,5 @@ will become: -@smallexample +@example Subject: ftpd exited with code 76 -@end smallexample +@end example @@ -1825,5 +1825,5 @@ terminated on a signal. Thus, using -@smallexample +@example $@{termination@} $@{retcode@} -@end smallexample +@end example @@ -1837,3 +1837,3 @@ message is used instead: -@smallexample +@example From: <> @@ -1842,3 +1842,3 @@ Subject: Component $@{component@} $@{termination@} $@{retcode@}. -@end smallexample +@end example @end deffn @@ -1864,5 +1864,5 @@ For example, the following statement instructs @command{pies} to use -@smallexample +@example mailer-program /usr/sbin/exim; -@end smallexample +@end example @@ -1872,5 +1872,5 @@ By default, the mailer program is invoked as follows: -@smallexample +@example /usr/sbin/sendmail -oi -t @var{rcpts} -@end smallexample +@end example @@ -1892,5 +1892,5 @@ envelope sender address: -@smallexample +@example mailer-command-line "sendmail -f root@@domain.com -oi -t"; -@end smallexample +@end example @end deffn @@ -1908,3 +1908,3 @@ An @acronym{ACL} is defined using @code{acl} block statement: @deffn {Config} acl -@smallexample +@example acl @{ @@ -1912,3 +1912,3 @@ acl @{ @} -@end smallexample +@end example @end deffn @@ -1926,3 +1926,3 @@ the @samp{defacl} statement: @deffn {Config} defacl @var{name} -@smallexample +@example defacl @var{name} @{ @@ -1930,3 +1930,3 @@ defacl @var{name} @{ @} -@end smallexample +@end example @@ -1969,5 +1969,5 @@ The @var{sub-acl} part, if present, allows to branch to another -@smallexample +@example acl @var{name} -@end smallexample +@end example @@ -2013,5 +2013,5 @@ To summarize, the syntax of an access statement is: -@smallexample +@example allow|deny [acl @var{name}] [from @var{addr-list}] -@end smallexample +@end example @@ -2033,3 +2033,3 @@ denied for anybody else: -@smallexample +@example @group @@ -2041,3 +2041,7 @@ acl @{ @end group -@end smallexample +@end example + +@node control +@section The Control Statement +@WRITEME @@ -2065,5 +2069,5 @@ standard @command{inetd} configuration file: -@smallexample +@example include-inetd /etc/inetd.conf; -@end smallexample +@end example @@ -2074,6 +2078,6 @@ directory: -@smallexample +@example include-inetd /etc/inetd.conf; include-inetd /etc/inetd.d; -@end smallexample +@end example @end deffn @@ -2083,5 +2087,5 @@ them in the command line, like this: -@smallexample +@example pies --syntax=inetd --config-file /etc/inetd.conf -@end smallexample +@end example @@ -2091,3 +2095,3 @@ format. Of course, several configuration file may be given: -@smallexample +@example @group @@ -2096,3 +2100,3 @@ pies --syntax=inetd \ @end group -@end smallexample +@end example @@ -2118,5 +2122,5 @@ compatible with that of the usual @command{inetd} utility, i.e.: -@smallexample +@example inetd [@var{option}] [@var{config} [@var{config}...]] [-- @var{pies-options}] -@end smallexample +@end example @@ -2183,3 +2187,3 @@ all MeTA1 components: -@smallexample +@example allgroups yes; @@ -2187,3 +2191,3 @@ stderr file @var{compname}.log chdir @var{queue-dir} -@end smallexample +@end example @@ -2204,3 +2208,3 @@ syslog channel: -@smallexample +@example include-meta1 /etc/meta1/meta1.conf @@ -2211,3 +2215,3 @@ component smtps @{ @} -@end smallexample +@end example @@ -2357,5 +2361,5 @@ source information. To enable source information, use: -@smallexample +@example source-info yes; -@end smallexample +@end example @@ -2759,3 +2763,3 @@ output are redirected to the syslog facility @samp{mail}, priorities -@smallexample +@example component pmult @{ @@ -2767,3 +2771,3 @@ component pmult @{ @} -@end smallexample +@end example @@ -2776,3 +2780,3 @@ is used to configure @command{pies} behavior for some exit codes. -@smallexample +@example # Sample pies configuration for running pmult and MeTA1 @@ -2809,3 +2813,3 @@ component pmult @{ include-meta1 "/etc/meta1/meta1.conf"; -@end smallexample +@end example @@ -2818,3 +2822,3 @@ and restricts access to them to two local subnets: -@smallexample +@example acl @{ @@ -2841,3 +2845,3 @@ component pop3d @{ @} -@end smallexample +@end example @@ -2846,6 +2850,6 @@ format: -@smallexample +@example ftp stream tcp nowait root /usr/sbin/ftpd ftpd -l -C pop3 stream tcp nowait root /usr/sbin/pop3d pop3d --inetd -@end smallexample +@end example @@ -2885,3 +2889,3 @@ messages with @var{name}. -@smallexample +@example pies @@ -2889,3 +2893,3 @@ pies --instance=inetd pies --instance=mta -@end smallexample +@end example @@ -2899,3 +2903,3 @@ using the @option{--status} command line option: -@smallexample +@example @group @@ -2915,3 +2919,3 @@ eklogin IR 13836 /usr/local/sbin/klogind -k -c -e @end group -@end smallexample +@end example @@ -2971,5 +2975,5 @@ listed in the next column. -@smallexample +@example $ pies -R pmult smtps -@end smallexample +@end example @@ -2979,5 +2983,5 @@ $ pies -R pmult smtps -@smallexample +@example $ pies --stop -@end smallexample +@end example @@ -2993,3 +2997,3 @@ actual dependency. For example: -@smallexample +@example @group @@ -3011,3 +3015,3 @@ Legend: @end group -@end smallexample +@end example @@ -3019,9 +3023,9 @@ means that @samp{smtps} depends on @samp{smar} and @samp{qmgr}. -@anchor{dump-prereq} -@xopindex{dump-prereq, described} +@anchor{trace-prereq} +@xopindex{trace-prereq, described} You can also list prerequisites explicitly: -@smallexample +@example @group -$ pies --dump-prereq +$ pies --trace-prereq qmgr: smar @@ -3030,3 +3034,37 @@ smtps: smar qmgr @end group -@end smallexample +@end example + +@noindent +To list prerequisites for a particular component, give its name in +the command line: + +@example +@group +$ pies --trace-prereq smtps +smtps: smar qmgr +@end group +@end example + +Any number of components can be given in the command line. + +@anchor{trace-depend} +A counterpart option @option{--trace-depend} lists dependencies. Its +usage is similar to the described above: + +@example +@group +$ pies --trace-depend +smtps +smtpc +qmgr: smtps, smtpc +smar: smtps, qmgr +@end group +@end example + +@example +@group +$ pies --trace-depend qmgr +qmgr: smtps, smtpc +@end group +@end example @@ -3066,5 +3104,11 @@ Dump dependency map. @xref{dump-depmap}. -@opsummary{dump-prereq} -@item --dump-prereq -Dump prerequisite charts. @xref{dump-prereq}. +@opsummary{trace-depend} +@item --trace-depend +List dependencies for components named in the command line. Without +arguments, dependencies for each component are listed. @xref{trace-depend}. + +@opsummary{trace-prereq} +@item --trace-prereq +List prerequisites for components named in the command line. Without +arguments, prerequisites for each component are listed. @xref{trace-prereq}. @@ -665,9 +665,15 @@ component_verify (struct component *comp, grecs_locus_t *locus) } - - if (comp->mode != pies_comp_exec - && comp->redir[RETR_OUT].type != redir_null) + + switch (comp->mode) { - COMPERR (grecs_error, - "%s", _("stdout redirection invalid in this mode")); - comp->redir[RETR_OUT].type = redir_null; + case pies_comp_accept: + case pies_comp_inetd: + if (comp->redir[RETR_OUT].type != redir_null) + { + COMPERR (grecs_error, + "%s", _("stdout redirection invalid in this mode")); + comp->redir[RETR_OUT].type = redir_null; + } + default: + break; } diff --git a/src/meta1parse.c b/src/meta1parse.c index 4b2fccb..528a80a 100644 --- a/src/meta1parse.c +++ b/src/meta1parse.c @@ -297,3 +297,5 @@ meta1_translate_node (struct grecs_node *node) int err = 0; - + + if (node->type != grecs_node_block) + return 0; comp = component_create (node->ident); @@ -311,3 +313,3 @@ meta1_translate_node (struct grecs_node *node) comp->privs.allgroups = 1; - comp->dir = META1_QUEUE_DIR (); + comp->dir = grecs_strdup (META1_QUEUE_DIR ()); comp->redir[RETR_ERR].type = redir_file; |