diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/comp.c | 10 | ||||
-rw-r--r-- | src/meta1parse.c | 4 |
2 files changed, 11 insertions, 3 deletions
@@ -661,19 +661,25 @@ component_verify (struct component *comp, grecs_locus_t *locus) | |||
661 | { | 661 | { |
662 | /* TRANSLATORS: `wait' is a keywords, do not translate. */ | 662 | /* TRANSLATORS: `wait' is a keywords, do not translate. */ |
663 | COMPERR (grecs_error, "%s", _("wait is useless in this mode")); | 663 | COMPERR (grecs_error, "%s", _("wait is useless in this mode")); |
664 | comp->flags &= ~CF_WAIT; | 664 | comp->flags &= ~CF_WAIT; |
665 | } | 665 | } |
666 | 666 | ||
667 | if (comp->mode != pies_comp_exec | 667 | switch (comp->mode) |
668 | && comp->redir[RETR_OUT].type != redir_null) | 668 | { |
669 | case pies_comp_accept: | ||
670 | case pies_comp_inetd: | ||
671 | if (comp->redir[RETR_OUT].type != redir_null) | ||
669 | { | 672 | { |
670 | COMPERR (grecs_error, | 673 | COMPERR (grecs_error, |
671 | "%s", _("stdout redirection invalid in this mode")); | 674 | "%s", _("stdout redirection invalid in this mode")); |
672 | comp->redir[RETR_OUT].type = redir_null; | 675 | comp->redir[RETR_OUT].type = redir_null; |
673 | } | 676 | } |
677 | default: | ||
678 | break; | ||
679 | } | ||
674 | 680 | ||
675 | for (i = RETR_OUT; i <= RETR_ERR; i++) | 681 | for (i = RETR_OUT; i <= RETR_ERR; i++) |
676 | { | 682 | { |
677 | if (comp->redir[i].type == redir_file | 683 | if (comp->redir[i].type == redir_file |
678 | && comp->redir[i].v.file[0] != '/') | 684 | && comp->redir[i].v.file[0] != '/') |
679 | { | 685 | { |
diff --git a/src/meta1parse.c b/src/meta1parse.c index 4b2fccb..528a80a 100644 --- a/src/meta1parse.c +++ b/src/meta1parse.c | |||
@@ -293,12 +293,14 @@ meta1_translate_node (struct grecs_node *node) | |||
293 | { | 293 | { |
294 | struct component *comp; | 294 | struct component *comp; |
295 | struct grecs_node *stmt; | 295 | struct grecs_node *stmt; |
296 | size_t len; | 296 | size_t len; |
297 | int err = 0; | 297 | int err = 0; |
298 | 298 | ||
299 | if (node->type != grecs_node_block) | ||
300 | return 0; | ||
299 | comp = component_create (node->ident); | 301 | comp = component_create (node->ident); |
300 | for (stmt = node->down; stmt; stmt = stmt->next) | 302 | for (stmt = node->down; stmt; stmt = stmt->next) |
301 | { | 303 | { |
302 | if (meta1_translate_stmt (stmt, comp)) | 304 | if (meta1_translate_stmt (stmt, comp)) |
303 | ++err; | 305 | ++err; |
304 | } | 306 | } |
@@ -306,13 +308,13 @@ meta1_translate_node (struct grecs_node *node) | |||
306 | { | 308 | { |
307 | component_free (comp); | 309 | component_free (comp); |
308 | return -1; | 310 | return -1; |
309 | } | 311 | } |
310 | 312 | ||
311 | comp->privs.allgroups = 1; | 313 | comp->privs.allgroups = 1; |
312 | comp->dir = META1_QUEUE_DIR (); | 314 | comp->dir = grecs_strdup (META1_QUEUE_DIR ()); |
313 | comp->redir[RETR_ERR].type = redir_file; | 315 | comp->redir[RETR_ERR].type = redir_file; |
314 | comp->redir[RETR_ERR].v.file = NULL; | 316 | comp->redir[RETR_ERR].v.file = NULL; |
315 | len = 0; | 317 | len = 0; |
316 | grecs_asprintf (&comp->redir[RETR_ERR].v.file, &len, | 318 | grecs_asprintf (&comp->redir[RETR_ERR].v.file, &len, |
317 | "%s/%s.log", META1_QUEUE_DIR (), comp->tag); | 319 | "%s/%s.log", META1_QUEUE_DIR (), comp->tag); |
318 | component_finish (comp, &node->locus); | 320 | component_finish (comp, &node->locus); |