case LDAP_FILTER_OP_EQ:
for (i = 0; i < count; i++) {
DEBUG_LDAP_ATTR_VAL
- if ((node->value->length == values[i]->bv_len) &&
+ if ((node->value->vb_length == values[i]->bv_len) &&
(strncasecmp(values[i]->bv_val, node->value->vb_strvalue, values[i]->bv_len) == 0)) {
filter_state = true;
break;
* Point t_end at the final character of the filter value
* - not the NULL - so we can check for trailing '*'
*/
- t_end = node->value->vb_strvalue + node->value->length - 1;
+ t_end = node->value->vb_strvalue + node->value->vb_length - 1;
for (i = 0; i < count; i++) {
DEBUG_LDAP_ATTR_VAL
{
vp_list_mod_t *n;
map_t *mod;
- fr_value_box_t empty_string = {
- .type = FR_TYPE_STRING,
- .datum = {
- .strvalue = "",
- },
- .length = 0,
- };
+ fr_value_box_t empty_string = *fr_box_strvalue_len("", 0);
n = list_mod_alloc(ctx);
if (!n) return NULL;
* parent VP. Because we're going to be moving them to the parent VP at some
* point. The ones which aren't moved will get deleted in this function.
*/
- token = fr_pair_list_afrom_str(state, da, box->vb_strvalue, box->length, children);
+ token = fr_pair_list_afrom_str(state, da, box->vb_strvalue, box->vb_length, children);
if (token == T_INVALID) {
RPEDEBUG("Failed parsing string '%pV' as attribute list", box);
return -1;
COERCE_B(FR_TYPE_OCTETS, dst->enumv);
}
- len = a->length + b->length;
+ len = a->vb_length + b->vb_length;
switch (op) {
case T_ADD: /* dst = a . b */
COERCE_B(FR_TYPE_STRING, dst->enumv);
}
- len = a->length + b->length;
+ len = a->vb_length + b->vb_length;
switch (op) {
case T_ADD:
/*
* Zero length box - no terminators here
*/
- if (uri_vb->length == 0) continue;
+ if (uri_vb->vb_length == 0) continue;
/*
* Look for URI part terminator
*/
- fr_sbuff_init_in(&sbuff, uri_vb->vb_strvalue, uri_vb->length);
+ fr_sbuff_init_in(&sbuff, uri_vb->vb_strvalue, uri_vb->vb_length);
do {
fr_sbuff_adv_until(&sbuff, SIZE_MAX, uri_part->terminals, '\0');
if ((request->rcode != RLM_MODULE_OK) && (request->rcode != RLM_MODULE_UPDATED)) goto send;
vp = fr_pair_find_by_da_nested(&request->reply_pairs, NULL, attr_ldap_sync_cookie);
- if ((vp) && (vp->data.length > 0)) {
+ if ((vp) && (vp->data.vb_length > 0)) {
fr_pair_remove(&request->reply_pairs, vp);
fr_pair_steal_append(local, &pairs, vp);
}
* as a starting point. The maximum length would be 12
* times the original if every character is 4 byte UTF8.
*/
- if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, arg->length * 2, arg->length * 12)) {
+ if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, arg->vb_length * 2, arg->vb_length * 12)) {
error:
RPEDEBUG("Failed to allocated buffer for escaped string");
talloc_free(vb);
fr_value_box_t *vb;
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstr_alloc(ctx, &out_p, vb, NULL, arg->length, arg->tainted) < 0) {
+ if (fr_value_box_bstr_alloc(ctx, &out_p, vb, NULL, arg->vb_length, arg->tainted) < 0) {
talloc_free(vb);
RPEDEBUG("Failed allocating space for unescaped string");
return XLAT_ACTION_FAIL;
}
- sbuff = FR_SBUFF_IN(out_p, arg->length);
+ sbuff = FR_SBUFF_IN(out_p, arg->vb_length);
p = arg->vb_strvalue;
- end = p + arg->length;
+ end = p + arg->vb_length;
while (*p) {
if (*p != '=') {
next:
* Maximum space needed for output would be 3 times the input if every
* char needed escaping
*/
- if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, in_vb->length * 3, in_vb->length * 3)) {
+ if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, in_vb->vb_length * 3, in_vb->vb_length * 3)) {
REDEBUG("Failed to allocate buffer for escaped string");
talloc_free(vb);
return XLAT_ACTION_FAIL;
/*
* Call the escape function, including the space for the trailing NULL
*/
- len = fr_ldap_escape_func(request, fr_sbuff_buff(&sbuff), in_vb->length * 3 + 1, in_vb->vb_strvalue, NULL);
+ len = fr_ldap_escape_func(request, fr_sbuff_buff(&sbuff), in_vb->vb_length * 3 + 1, in_vb->vb_strvalue, NULL);
/*
* Trim buffer to fit used space and assign to box
/*
* Maximum space needed for output will be the same as the input
*/
- if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, in_vb->length, in_vb->length)) {
+ if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, in_vb->vb_length, in_vb->vb_length)) {
REDEBUG("Failed to allocate buffer for unescaped string");
talloc_free(vb);
return XLAT_ACTION_FAIL;
/*
* Call the unescape function, including the space for the trailing NULL
*/
- len = fr_ldap_unescape_func(request, fr_sbuff_buff(&sbuff), in_vb->length + 1, in_vb->vb_strvalue, NULL);
+ len = fr_ldap_unescape_func(request, fr_sbuff_buff(&sbuff), in_vb->vb_length + 1, in_vb->vb_strvalue, NULL);
/*
* Trim buffer to fit used space and assign to box
* Maximum space needed for output would be 3 times the input if every
* char needed escaping
*/
- if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, vb->length * 3, vb->length * 3)) {
+ if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, vb->vb_length * 3, vb->vb_length * 3)) {
fr_strerror_printf_push("Failed to allocate buffer for escaped argument");
return -1;
}
/*
* Call the escape function, including the space for the trailing NULL
*/
- len = fr_ldap_escape_func(NULL, fr_sbuff_buff(&sbuff), vb->length * 3 + 1, vb->vb_strvalue, NULL);
+ len = fr_ldap_escape_func(NULL, fr_sbuff_buff(&sbuff), vb->vb_length * 3 + 1, vb->vb_strvalue, NULL);
fr_sbuff_trim_talloc(&sbuff, len);
fr_value_box_clear_value(vb);
*/
} else if (strncasecmp(arg->vb_strvalue, "NT-Hash", 7) == 0) {
arg = fr_value_box_list_next(in, arg);
- if ((!arg) || (arg->length == 0))
+ if ((!arg) || (arg->vb_length == 0))
return XLAT_ACTION_FAIL;
if (mschap_nt_password_hash(buffer, arg->vb_strvalue) < 0) {
*/
} else if (strncasecmp(arg->vb_strvalue, "LM-Hash", 7) == 0) {
arg = fr_value_box_list_next(in, arg);
- if ((!arg) || (arg->length == 0))
+ if ((!arg) || (arg->vb_length == 0))
return XLAT_ACTION_FAIL;
smbdes_lmpwdhash(arg->vb_strvalue, buffer);
while ((vb = fr_value_box_list_next(head, vb))) {
switch (vb->type) {
case FR_TYPE_STRING:
- sv = newSVpvn(vb->vb_strvalue, vb->length);
+ sv = newSVpvn(vb->vb_strvalue, vb->vb_length);
break;
case FR_TYPE_OCTETS:
/*
* Single child value - add as scalar
*/
- if (child->length == 0) continue;
+ if (child->vb_length == 0) continue;
DEBUG3("Passing single value %pV", child);
- sv = newSVpvn(child->vb_strvalue, child->length);
+ sv = newSVpvn(child->vb_strvalue, child->vb_length);
if (child->tainted) SvTAINT(sv);
XPUSHs(sv_2mortal(sv));
continue;
fr_curl_io_request_t *randle = talloc_get_type_abort(uctx, fr_curl_io_request_t);
request_t *request = randle->request;
- escaped = curl_easy_escape(randle->candle, vb->vb_strvalue, vb->length);
+ escaped = curl_easy_escape(randle->candle, vb->vb_strvalue, vb->vb_length);
if (!escaped) return -1;
/*
* Returned string the same length - nothing changed
*/
- if (strlen(escaped) == vb->length) {
+ if (strlen(escaped) == vb->vb_length) {
RDEBUG4("Tainted value %pV needed no escaping", vb);
curl_free(escaped);
return 0;
/*
* Maximum escaped length is 3 * original - if every character needs escaping
*/
- if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, vb->length * 3, vb->length * 3)) {
+ if (!fr_sbuff_init_talloc(vb, &sbuff, &sbuff_ctx, vb->vb_length * 3, vb->vb_length * 3)) {
fr_strerror_printf_push("Failed to allocate buffer for escaped sql argument");
return -1;
}
- len = inst->sql_escape_func(request, fr_sbuff_buff(&sbuff), vb->length * 3 + 1, vb->vb_strvalue, handle);
+ len = inst->sql_escape_func(request, fr_sbuff_buff(&sbuff), vb->vb_length * 3 + 1, vb->vb_strvalue, handle);
/*
* fr_value_box_strdup_shallow resets the dlist entries - take a copy
fr_value_box_t *count_vb = fr_value_box_list_next(in, query_vb);
unbound_request_t *ur;
- if (host_vb->length == 0) {
+ if (host_vb->vb_length == 0) {
REDEBUG("Can't resolve zero length host");
return XLAT_ACTION_FAIL;
}
}
} else if (data_vb->type == FR_TYPE_STRING) {
input = (uint8_t const *)data_vb->vb_strvalue;
- input_len = data_vb->length;
+ input_len = data_vb->vb_length;
} else {
input = data_vb->vb_octets;
- input_len = data_vb->length;
+ input_len = data_vb->vb_length;
}
offset = offset_vb->vb_uint32;