* Loop over the children of this group.
*/
while ((ci = cf_item_next(g->cs, ci))) {
+ if (cf_item_is_data(ci)) continue;
+
/*
* Sections are references to other groups, or
* to modules with updated return codes.
}
add_child(g, single);
- /*
- * Or it MUST be a module instance with action.
- */
- } else if (parent->type != UNLANG_TYPE_MODULE_CALL) {
- cf_log_err(ci, "Invalid location for action over-ride");
+ } else if (!parent || (parent->type != UNLANG_TYPE_MODULE_CALL)) {
+ cf_log_err(cp, "Invalid location for action over-ride");
talloc_free(c);
return NULL;
- } else if (!compile_action_pair(c, cp)) {
- talloc_free(c);
- return NULL;
- } /* else it worked */
- } else if (cf_item_is_data(ci)) {
- continue;
+ } else {
+ if (!compile_action_pair(c, cp)) {
+ talloc_free(c);
+ return NULL;
+ }
+ }
} else {
rad_assert(0);
}
update request {
Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
}
- fail = 1
+
+ #
+ # We can only over-ride actions in an "actions" subsection,
+ # and then only as the last item in a group.
+ #
+ actions {
+ fail = 1
+ }
}
if (fail) {
ok
update request {
Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
}
- fail = 1
+
+ actions {
+ fail = 1
+ }
}
if (fail) {
ok
update request {
Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
}
- fail = 1
+
+ actions {
+ fail = 1
+ }
}
if (fail) {
ok
update request {
Tmp-String-0 := `/bin/sh -c "test ! -e $ENV{MODULE_TEST_DIR}/test_b.log"`
}
- fail = 1
+
+ actions {
+ fail = 1
+ }
}
if (fail) {
test_fail
update request {
Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
}
- fail = 1
+
+ actions {
+ fail = 1
+ }
}
if (fail) {
ok
update request {
Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
}
- fail = 1
+
+ actions {
+ fail = 1
+ }
}
if (fail) {
ok