]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Advance output cursor so we print debug correctly in xlat_eval
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 25 Jan 2018 19:08:17 +0000 (12:08 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 25 Jan 2018 19:12:30 +0000 (12:12 -0700)
src/main/xlat_eval.c

index f13ae2808598edfd81d84ff447382850c3d4cda7..73edfe8ae46a6151e9edc0fbfa4f61b3fc58e928 100644 (file)
@@ -208,6 +208,8 @@ static xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, fr_cursor_t *out, REQ
        }
 
        fr_cursor_append(out, value);
+       fr_cursor_next(out);                            /* Advance to our first value */
+
        return XLAT_ACTION_DONE;
 }
 
@@ -369,6 +371,7 @@ static xlat_action_t xlat_eval_pair_virtual(TALLOC_CTX *ctx, fr_cursor_t *out, R
 
 done:
        fr_cursor_append(out, value);
+       fr_cursor_next(out);                            /* Advance to our first value */
 
        return XLAT_ACTION_DONE;
 }
@@ -420,6 +423,7 @@ static xlat_action_t xlat_eval_pair(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *
                        }
                        value->datum.int32 = 0;
                        fr_cursor_append(out, value);
+                       fr_cursor_next(out);                    /* Advance to our first value */
 
                        return XLAT_ACTION_DONE;
                }
@@ -443,6 +447,7 @@ static xlat_action_t xlat_eval_pair(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *
                value = fr_value_box_alloc(ctx, FR_TYPE_UINT32, NULL, false);
                value->datum.uint32 = count;
                fr_cursor_append(out, value);
+               fr_cursor_next(out);                            /* Advance to our first value */
 
                return XLAT_ACTION_DONE;
        }
@@ -464,6 +469,7 @@ static xlat_action_t xlat_eval_pair(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *
                        fr_value_box_copy(value, value, &vp->data);
                        fr_cursor_append(out, value);
                }
+               fr_cursor_next(out);                            /* Advance to our first value */
 
                return XLAT_ACTION_DONE;
 
@@ -475,8 +481,11 @@ static xlat_action_t xlat_eval_pair(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *
                vp = fr_cursor_current(&cursor);                        /* NULLness checked above */
                value = fr_value_box_alloc(ctx, vp->data.type, vp->da, vp->data.tainted);
                if (!value) goto oom;
+
                fr_value_box_copy(value, value, &vp->data);     /* Also dups taint */
                fr_cursor_append(out, value);
+               fr_cursor_next(out);                            /* Advance to our first value */
+
                return XLAT_ACTION_DONE;
        }
 }