Skip to content

Commit

Permalink
ldb controls: base64 encode VLV response context strings
Browse files Browse the repository at this point in the history
Pair-programmed-with: Douglas Bagnall <[email protected]>
Signed-off-by: Garming Sam <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
GSam authored and abartlet committed Mar 9, 2016
1 parent 182c87f commit 2973d4c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/ldb/common/ldb_controls.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,20 @@ char *ldb_control_to_string(TALLOC_CTX *mem_ctx, const struct ldb_control *contr
struct ldb_vlv_resp_control *rep_control = talloc_get_type(control->data,
struct ldb_vlv_resp_control);

res = talloc_asprintf(mem_ctx, "%s:%d:%d:%d:%d:%d:%s",
char *cookie;
const uint8_t *c = (uint8_t*) rep_control->contextId;

cookie = ldb_base64_encode(mem_ctx,
rep_control->contextId,
rep_control->ctxid_len);

res = talloc_asprintf(mem_ctx, "%s:%d:%d:%d:%d:%s",
LDB_CONTROL_VLV_RESP_NAME,
control->critical,
rep_control->targetPosition,
rep_control->contentCount,
rep_control->vlv_result,
rep_control->ctxid_len,
rep_control->contextId);
cookie);

return res;
}
Expand Down

0 comments on commit 2973d4c

Please sign in to comment.