2 * parser.c Parse various things
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 * Copyright 2013 Alan DeKok <aland@freeradius.org>
25 #include <freeradius-devel/radiusd.h>
26 #include <freeradius-devel/parser.h>
27 #include <freeradius-devel/rad_assert.h>
31 #define PW_CAST_BASE (1850)
33 static const FR_NAME_NUMBER allowed_return_codes[] = {
47 * This file shouldn't use any functions from the server core.
50 size_t fr_cond_sprint(char *buffer, size_t bufsize, fr_cond_t const *c)
54 char *end = buffer + bufsize - 1;
58 *(p++) = '!'; /* FIXME: only allow for child? */
62 case COND_TYPE_EXISTS:
63 rad_assert(c->data.vpt != NULL);
65 len = snprintf(p, end - p, "<%s>", fr_int2str(dict_attr_types,
66 c->cast->type, "??"));
70 len = radius_tmpl2str(p, end - p, c->data.vpt);
75 rad_assert(c->data.map != NULL);
77 *(p++) = '['; /* for extra-clear debugging */
80 len = snprintf(p, end - p, "<%s>", fr_int2str(dict_attr_types,
81 c->cast->type, "??"));
85 len = radius_map2str(p, end - p, c->data.map);
93 rad_assert(c->data.child != NULL);
95 len = fr_cond_sprint(p, end - p, c->data.child);
101 strlcpy(buffer, "true", bufsize);
102 return strlen(buffer);
104 case COND_TYPE_FALSE:
105 strlcpy(buffer, "false", bufsize);
106 return strlen(buffer);
113 if (c->next_op == COND_NONE) {
114 rad_assert(c->next == NULL);
119 if (c->next_op == COND_AND) {
120 strlcpy(p, " && ", end - p);
123 } else if (c->next_op == COND_OR) {
124 strlcpy(p, " || ", end - p);
136 static ssize_t condition_tokenize_string(TALLOC_CTX *ctx, char const *start, char **out,
137 FR_TOKEN *op, char const **error)
139 char const *p = start;
147 *op = T_DOUBLE_QUOTED_STRING;
151 *op = T_SINGLE_QUOTED_STRING;
155 *op = T_BACK_QUOTED_STRING;
159 *op = T_OP_REG_EQ; /* a bit of a hack. */
164 *out = talloc_array(ctx, char, strlen(start) - 1); /* + 2 - 1 */
165 if (!*out) return -1;
179 *error = "End of string after escape";
204 *error = "Unterminated string";
208 static ssize_t condition_tokenize_word(TALLOC_CTX *ctx, char const *start, char **out,
209 FR_TOKEN *op, char const **error)
212 char const *p = start;
214 if ((*p == '"') || (*p == '\'') || (*p == '`') || (*p == '/')) {
215 return condition_tokenize_string(ctx, start, out, op, error);
219 if (*p == '&') p++; /* special-case &User-Name */
223 * The LHS should really be limited to only a few
224 * things. For now, we allow pretty much anything.
227 *error = "Unexpected escape";
239 * Spaces or special characters delineate the word
241 if (isspace((int) *p) || (*p == '&') || (*p == '|') ||
242 (*p == '!') || (*p == '=') || (*p == '<') || (*p == '>')) {
246 if ((*p == '"') || (*p == '\'') || (*p == '`')) {
247 *error = "Unexpected start of string";
256 *error = "Empty string is invalid";
260 *out = talloc_array(ctx, char, len + 1);
261 memcpy(*out, start, len);
267 static ssize_t condition_tokenize_cast(char const *start, DICT_ATTR const **pda, char const **error)
269 char const *p = start;
273 while (isspace((int) *p)) p++; /* skip spaces before condition */
275 if (*p != '<') return 0;
279 while (*q && *q != '>') q++;
281 cast = fr_substr2int(dict_attr_types, p, PW_TYPE_INVALID, q - p);
282 if (cast == PW_TYPE_INVALID) {
283 *error = "Invalid data type in cast";
288 * We can only cast to basic data types. Complex ones
292 #ifdef WITH_ASCEND_BINARY
293 case PW_TYPE_ABINARY:
295 case PW_TYPE_COMBO_IP:
297 case PW_TYPE_EXTENDED:
298 case PW_TYPE_LONG_EXTENDED:
301 *error = "Forbidden data type in cast";
308 *pda = dict_attrbyvalue(PW_CAST_BASE + cast, 0);
310 *error = "Cannot cast to this data type";
316 while (isspace((int) *q)) q++; /* skip spaces after cast */
322 * Less code means less bugs
324 #define return_P(_x) *error = _x;goto return_p
325 #define return_0(_x) *error = _x;goto return_0
326 #define return_lhs(_x) *error = _x;goto return_lhs
327 #define return_rhs(_x) *error = _x;goto return_rhs
328 #define return_SLEN goto return_slen
331 /** Tokenize a conditional check
333 * @param[in] ctx for talloc
334 * @param[in] ci for CONF_ITEM
335 * @param[in] start the start of the string to process. Should be "(..."
336 * @param[in] brace look for a closing brace
337 * @param[in] flags do one/two pass
338 * @param[out] pcond pointer to the returned condition structure
339 * @param[out] error the parse error (if any)
340 * @return length of the string skipped, or when negative, the offset to the offending error
342 static ssize_t condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *start, int brace, fr_cond_t **pcond, char const **error, int flags)
345 char const *p = start;
346 char const *lhs_p, *rhs_p;
349 FR_TOKEN op, lhs_type, rhs_type;
351 c = talloc_zero(ctx, fr_cond_t);
353 rad_assert(c != NULL);
355 lhs_type = rhs_type = T_OP_INVALID;
357 while (isspace((int) *p)) p++; /* skip spaces before condition */
360 return_P("Empty condition is invalid");
369 while (isspace((int) *p)) p++; /* skip spaces after negation */
375 return_P("Double negation is invalid");
386 * We've already eaten one layer of
387 * brackets. Go recurse to get more.
389 c->type = COND_TYPE_CHILD;
391 slen = condition_tokenize(c, ci, p, true, &c->data.child, error, flags);
396 if (!c->data.child) {
397 return_P("Empty condition is invalid");
401 while (isspace((int) *p)) p++; /* skip spaces after (COND)*/
403 } else { /* it's a bare FOO==BAR */
405 * We didn't see anything special. The condition must be one of
415 return_P("Conditional check cannot begin with a regular expression");
418 slen = condition_tokenize_cast(p, &c->cast, error);
425 slen = condition_tokenize_word(c, p, &lhs, &lhs_type, error);
431 while (isspace((int)*p)) p++; /* skip spaces after LHS */
434 * We may (or not) have an operator
443 * don't skip the brace. We'll look for it later.
452 return_P("No closing brace at end of string");
460 } else if (((p[0] == '&') && (p[1] == '&')) ||
461 ((p[0] == '|') && (p[1] == '|'))) {
465 return_0("Cannot do cast for existence check");
468 c->type = COND_TYPE_EXISTS;
471 c->data.vpt = radius_str2tmpl(c, lhs, lhs_type, REQUEST_CURRENT, PAIR_LIST_REQUEST);
473 return_P("Failed creating exists");
476 rad_assert(c->data.vpt->type != VPT_TYPE_REGEX);
478 } else { /* it's an operator */
482 * The next thing should now be a comparison operator.
485 c->type = COND_TYPE_MAP;
490 return_P("Invalid text. Expected comparison operator");
497 } else if (p[1] == '~') {
503 } else if (p[1] == '*') {
504 if (lhs_type != T_BARE_WORD) {
505 return_P("Cannot use !* on a string");
512 goto invalid_operator;
521 } else if (p[1] == '~') {
527 } else if (p[1] == '*') {
528 if (lhs_type != T_BARE_WORD) {
529 return_P("Cannot use =* on a string");
537 return_P("Invalid operator");
565 while (isspace((int) *p)) p++; /* skip spaces after operator */
568 return_P("Expected text after operator");
572 * Cannot have a cast on the RHS.
573 * But produce good errors, too.
576 DICT_ATTR const *cast_da;
578 slen = condition_tokenize_cast(p, &cast_da, error);
584 return_P("Unexpected cast");
587 if (c->cast != cast_da) {
588 return_P("Cannot cast to a different data type");
591 return_P("Unnecessary cast");
598 slen = condition_tokenize_word(c, p, &rhs, &rhs_type, error);
604 * Sanity checks for regexes.
608 return_P("Expected regular expression");
614 if (p[slen] == 'i') {
619 } else if (!regex && (*p == '/')) {
620 return_P("Unexpected regular expression");
623 c->data.map = radius_str2map(c, lhs, lhs_type, op, rhs, rhs_type,
624 REQUEST_CURRENT, PAIR_LIST_REQUEST,
625 REQUEST_CURRENT, PAIR_LIST_REQUEST);
629 * FIXME: In the future,
631 * know whether this is
633 * it's pass2, then an
634 * unknown attribute is a
637 return_0("Unknown attribute");
639 return_0("Syntax error");
643 * Could have been a reference to an attribute which is registered later.
644 * Mark it as being checked in pass2.
646 if ((lhs_type == T_BARE_WORD) &&
647 (c->data.map->dst->type == VPT_TYPE_LITERAL)) {
648 c->pass2_fixup = PASS2_FIXUP_ATTR;
652 * Save the CONF_ITEM for later.
654 c->data.map->ci = ci;
657 * @todo: check LHS and RHS separately, to
660 if ((c->data.map->src->type == VPT_TYPE_LIST) ||
661 (c->data.map->dst->type == VPT_TYPE_LIST)) {
662 return_0("Cannot use list references in condition");
666 * Check cast type. We can have the RHS
667 * a string if the LHS has a cast. But
668 * if the RHS is an attr, it MUST be the
669 * same type as the LHS.
672 if ((c->data.map->src->type == VPT_TYPE_ATTR) &&
673 (c->cast->type != c->data.map->src->da->type)) {
677 if (c->data.map->src->type == VPT_TYPE_REGEX) {
678 return_0("Cannot use cast with regex comparison");
682 * The LHS is a literal which has been cast to a data type.
683 * Cast it to the appropriate data type.
685 if ((c->data.map->dst->type == VPT_TYPE_LITERAL) &&
686 !radius_cast_tmpl(c->data.map->dst, c->cast)) {
687 *error = "Failed to parse field";
688 if (lhs) talloc_free(lhs);
689 if (rhs) talloc_free(rhs);
691 return -(lhs_p - start);
695 * The RHS is a literal, and the LHS has been cast to a data
698 if ((c->data.map->dst->type == VPT_TYPE_DATA) &&
699 (c->data.map->src->type == VPT_TYPE_LITERAL) &&
700 !radius_cast_tmpl(c->data.map->src, c->data.map->dst->da)) {
701 return_rhs("Failed to parse field");
705 * Casting to a redundant type means we don't need the cast.
707 * Do this LAST, as the rest of the code above assumes c->cast
710 if ((c->data.map->dst->type == VPT_TYPE_ATTR) &&
711 (c->cast->type == c->data.map->dst->da->type)) {
717 * Two attributes? They must be of the same type
719 if ((c->data.map->src->type == VPT_TYPE_ATTR) &&
720 (c->data.map->dst->type == VPT_TYPE_ATTR) &&
721 (c->data.map->dst->da->type != c->data.map->src->da->type)) {
723 return_0("Attribute comparisons must be of the same data type");
727 * Without a cast, we can't compare "foo" to User-Name,
728 * it has to be done the other way around.
730 if ((c->data.map->src->type == VPT_TYPE_ATTR) &&
731 (c->data.map->dst->type != VPT_TYPE_ATTR)) {
732 *error = "Cannot use attribute reference on right side of condition";
734 if (lhs) talloc_free(lhs);
735 if (rhs) talloc_free(rhs);
741 * Invalid: User-Name == bob
742 * Valid: User-Name == "bob"
744 * There's no real reason for
745 * this, other than consistency.
747 if ((c->data.map->dst->type == VPT_TYPE_ATTR) &&
748 (c->data.map->src->type != VPT_TYPE_ATTR) &&
749 (c->data.map->dst->da->type == PW_TYPE_STRING) &&
750 (c->data.map->op != T_OP_CMP_TRUE) &&
751 (c->data.map->op != T_OP_CMP_FALSE) &&
752 (rhs_type == T_BARE_WORD)) {
753 return_rhs("Must have string as value for attribute");
757 * Quotes around non-string
758 * attributes mean that it's
759 * either xlat, or an exec.
761 if ((c->data.map->dst->type == VPT_TYPE_ATTR) &&
762 (c->data.map->src->type != VPT_TYPE_ATTR) &&
763 (c->data.map->dst->da->type != PW_TYPE_STRING) &&
764 (c->data.map->dst->da->type != PW_TYPE_OCTETS) &&
765 (c->data.map->dst->da->type != PW_TYPE_DATE) &&
766 (rhs_type == T_SINGLE_QUOTED_STRING)) {
767 *error = "Value must be an unquoted string";
769 if (lhs) talloc_free(lhs);
770 if (rhs) talloc_free(rhs);
772 return -(rhs_p - start);
776 * The LHS has been cast to a data type, and the RHS is a
777 * literal. Cast the RHS to the type of the cast.
779 if (c->cast && (c->data.map->src->type == VPT_TYPE_LITERAL) &&
780 !radius_cast_tmpl(c->data.map->src, c->cast)) {
781 return_rhs("Failed to parse field");
785 * The LHS is an attribute, and the RHS is a literal. Cast the
786 * RHS to the data type of the LHS.
788 if ((c->data.map->dst->type == VPT_TYPE_ATTR) &&
789 (c->data.map->src->type == VPT_TYPE_LITERAL) &&
790 !radius_cast_tmpl(c->data.map->src, c->data.map->dst->da)) {
791 DICT_ATTR const *da = c->data.map->dst->da;
793 if ((da->vendor == 0) &&
794 ((da->attr == PW_AUTH_TYPE) ||
795 (da->attr == PW_AUTZ_TYPE) ||
796 (da->attr == PW_ACCT_TYPE) ||
797 (da->attr == PW_SESSION_TYPE) ||
798 (da->attr == PW_POST_AUTH_TYPE) ||
799 (da->attr == PW_PRE_PROXY_TYPE) ||
800 (da->attr == PW_POST_PROXY_TYPE) ||
801 (da->attr == PW_PRE_ACCT_TYPE) ||
802 (da->attr == PW_RECV_COA_TYPE) ||
803 (da->attr == PW_SEND_COA_TYPE))) {
805 * The types for these attributes are dynamically allocated
806 * by modules.c, so we can't enforce strictness here.
808 c->pass2_fixup = PASS2_FIXUP_TYPE;
811 return_rhs("Failed to parse value for attribute");
818 while (isspace((int) *p)) p++; /* skip spaces after RHS */
820 } /* parse a condition (COND) or FOO OP BAR*/
827 return_P("Unexpected closing brace");
831 while (isspace((int) *p)) p++; /* skip spaces after closing brace */
836 * End of string is now allowed.
840 return_P("No closing brace at end of string");
846 if (!(((p[0] == '&') && (p[1] == '&')) ||
847 ((p[0] == '|') && (p[1] == '|')))) {
848 *error = "Unexpected text after condition";
850 if (lhs) talloc_free(lhs);
851 if (rhs) talloc_free(rhs);
857 * Recurse to parse the next condition.
863 * May still be looking for a closing brace.
865 slen = condition_tokenize(c, ci, p, brace, &c->next, error, flags);
868 if (lhs) talloc_free(lhs);
869 if (rhs) talloc_free(rhs);
871 return slen - (p - start);
877 * Normalize the condition before returning.
879 * We collapse multiple levels of braces to one. Then
880 * convert maps to literals. Then literals to true/false
881 * statements. Then true/false ||/&& followed by other
882 * conditions to just conditions.
884 * Order is important. The more complex cases are
885 * converted to simpler ones, from the most complex cases
886 * to the simplest ones.
891 * (FOO) ... --> FOO ...
893 if ((c->type == COND_TYPE_CHILD) && !c->data.child->next) {
896 child = talloc_steal(ctx, c->data.child);
897 c->data.child = NULL;
899 child->next = talloc_steal(child, c->next);
902 child->next_op = c->next_op;
905 * Set the negation properly
907 if ((c->negate && !child->negate) ||
908 (!c->negate && child->negate)) {
909 child->negate = true;
911 child->negate = false;
920 * (FOO ...) --> FOO ...
922 * But don't do !(FOO || BAR) --> !FOO || BAR
923 * Because that's different.
925 if ((c->type == COND_TYPE_CHILD) &&
926 !c->next && !c->negate) {
929 child = talloc_steal(ctx, c->data.child);
930 c->data.child = NULL;
938 * Convert maps to literals. Convert one form of map to
939 * a standardized form. This doesn't make any
940 * theoretical difference, but it does mean that the
941 * run-time evaluation has fewer cases to check.
943 if (c->type == COND_TYPE_MAP) do {
945 * !FOO !~ BAR --> FOO =~ BAR
947 if (c->negate && (c->data.map->op == T_OP_REG_NE)) {
949 c->data.map->op = T_OP_REG_EQ;
953 * FOO !~ BAR --> !FOO =~ BAR
955 if (!c->negate && (c->data.map->op == T_OP_REG_NE)) {
957 c->data.map->op = T_OP_REG_EQ;
961 * !FOO != BAR --> FOO == BAR
963 if (c->negate && (c->data.map->op == T_OP_NE)) {
965 c->data.map->op = T_OP_CMP_EQ;
969 * This next one catches "LDAP-Group != foo",
970 * which doesn't work as-is, but this hack fixes
973 * FOO != BAR --> !FOO == BAR
975 if (!c->negate && (c->data.map->op == T_OP_NE)) {
977 c->data.map->op = T_OP_CMP_EQ;
982 * FOO !* BAR --> !FOO
984 if ((c->data.map->op == T_OP_CMP_TRUE) ||
985 (c->data.map->op == T_OP_CMP_FALSE)) {
986 value_pair_tmpl_t *vpt;
988 vpt = talloc_steal(c, c->data.map->dst);
989 c->data.map->dst = NULL;
992 * Invert the negation bit.
994 if (c->data.map->op == T_OP_CMP_FALSE) {
995 c->negate = !c->negate;
998 TALLOC_FREE(c->data.map);
1000 c->type = COND_TYPE_EXISTS;
1002 break; /* it's no longer a map */
1006 * Both are data (IP address, integer, etc.)
1008 * We can do the evaluation here, so that it
1009 * doesn't need to be done at run time
1011 if ((c->data.map->dst->type == VPT_TYPE_DATA) &&
1012 (c->data.map->src->type == VPT_TYPE_DATA)) {
1015 rad_assert(c->cast != NULL);
1017 rcode = radius_evaluate_map(NULL, 0, 0, c);
1018 TALLOC_FREE(c->data.map);
1022 c->type = COND_TYPE_TRUE;
1024 c->type = COND_TYPE_FALSE;
1027 break; /* it's no longer a map */
1031 * Both are literal strings. They're not parsed
1032 * as VPT_TYPE_DATA because there's no cast to an
1035 * We can do the evaluation here, so that it
1036 * doesn't need to be done at run time
1038 if ((c->data.map->src->type == VPT_TYPE_LITERAL) &&
1039 (c->data.map->dst->type == VPT_TYPE_LITERAL)) {
1042 rad_assert(c->cast == NULL);
1043 rad_assert(c->regex_i == false);
1045 rcode = radius_evaluate_map(NULL, 0, 0, c);
1047 c->type = COND_TYPE_TRUE;
1049 c->type = COND_TYPE_FALSE;
1053 * Free map after using it above.
1055 TALLOC_FREE(c->data.map);
1061 * Existence checks. We short-circuit static strings,
1064 if (c->type == COND_TYPE_EXISTS) {
1065 switch (c->data.vpt->type) {
1073 * 'true' and 'false' are special strings
1074 * which mean themselves.
1076 * For integers, 0 is false, all other
1077 * integers are true.
1079 * For strings, '' and "" are false.
1080 * 'foo' and "foo" are true.
1082 * The str2tmpl function takes care of
1083 * marking "%{foo}" as VPT_TYPE_XLAT, so
1084 * the strings here are fixed at compile
1087 * `exec` and "%{...}" are left alone.
1089 * Bare words must be module return
1092 case VPT_TYPE_LITERAL:
1093 if ((strcmp(c->data.vpt->name, "true") == 0) ||
1094 (strcmp(c->data.vpt->name, "1") == 0)) {
1095 c->type = COND_TYPE_TRUE;
1096 TALLOC_FREE(c->data.vpt);
1098 } else if ((strcmp(c->data.vpt->name, "false") == 0) ||
1099 (strcmp(c->data.vpt->name, "0") == 0)) {
1100 c->type = COND_TYPE_FALSE;
1101 TALLOC_FREE(c->data.vpt);
1103 } else if (!*c->data.vpt->name) {
1104 c->type = COND_TYPE_FALSE;
1105 TALLOC_FREE(c->data.vpt);
1107 } else if ((lhs_type == T_SINGLE_QUOTED_STRING) ||
1108 (lhs_type == T_DOUBLE_QUOTED_STRING)) {
1109 c->type = COND_TYPE_TRUE;
1110 TALLOC_FREE(c->data.vpt);
1112 } else if (lhs_type == T_BARE_WORD) {
1116 for (q = c->data.vpt->name;
1119 if (!isdigit((int) *q)) {
1125 * It's all digits, and therefore
1129 c->type = COND_TYPE_TRUE;
1130 TALLOC_FREE(c->data.vpt);
1134 rcode = fr_str2int(allowed_return_codes,
1135 c->data.vpt->name, 0);
1137 return_0("Expected a module return code");
1142 * Else lhs_type==T_OP_INVALID, and this
1143 * node was made by promoting a child
1144 * which had already been normalized.
1149 return_0("Cannot use data here");
1152 return_0("Internal sanity check failed");
1159 if (c->type == COND_TYPE_TRUE) {
1162 c->type = COND_TYPE_FALSE;
1169 if (c->type == COND_TYPE_FALSE) {
1172 c->type = COND_TYPE_TRUE;
1177 * true && FOO --> FOO
1179 if ((c->type == COND_TYPE_TRUE) &&
1180 (c->next_op == COND_AND)) {
1183 next = talloc_steal(ctx, c->next);
1192 * false && FOO --> false
1194 if ((c->type == COND_TYPE_FALSE) &&
1195 (c->next_op == COND_AND)) {
1196 talloc_free(c->next);
1198 c->next_op = COND_NONE;
1202 * false || FOO --> FOO
1204 if ((c->type == COND_TYPE_FALSE) &&
1205 (c->next_op == COND_OR)) {
1208 next = talloc_steal(ctx, c->next);
1217 * true || FOO --> true
1219 if ((c->type == COND_TYPE_TRUE) &&
1220 (c->next_op == COND_OR)) {
1221 talloc_free(c->next);
1223 c->next_op = COND_NONE;
1226 if (lhs) talloc_free(lhs);
1227 if (rhs) talloc_free(rhs);
1233 /** Tokenize a conditional check
1235 * @param[in] ctx for talloc
1236 * @param[in] ci for CONF_ITEM
1237 * @param[in] start the start of the string to process. Should be "(..."
1238 * @param[out] head the parsed condition structure
1239 * @param[out] error the parse error (if any)
1240 * @param[in] flags do one/two pass
1241 * @return length of the string skipped, or when negative, the offset to the offending error
1243 ssize_t fr_condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *start, fr_cond_t **head, char const **error, int flags)
1245 return condition_tokenize(ctx, ci, start, false, head, error, flags);
1251 bool fr_condition_walk(fr_cond_t *c, bool (*callback)(void *, fr_cond_t *), void *ctx)
1255 * Process this one, exit on error.
1257 if (!callback(ctx, c)) return false;
1260 case COND_TYPE_INVALID:
1263 case COND_TYPE_EXISTS:
1265 case COND_TYPE_TRUE:
1266 case COND_TYPE_FALSE:
1269 case COND_TYPE_CHILD:
1271 * Walk over the child.
1273 if (!fr_condition_walk(c->data.child, callback, ctx)) {
1281 if (c->next_op == COND_NONE) break;
1284 * process the next sibling