Skip to content

Commit

Permalink
Don't call radius_pairmove. It does too much work.
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Mar 15, 2016
1 parent 5c1b314 commit 8afce71
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/modules/rlm_sql/rlm_sql.c
Expand Up @@ -498,8 +498,13 @@ int sql_set_user(rlm_sql_t *inst, REQUEST *request, char const *username)

fr_pair_value_strsteal(vp, expanded);
RDEBUG2("SQL-User-Name set to '%s'", vp->vp_strvalue);
vp->op = T_OP_SET;
radius_pairmove(request, &request->packet->vps, vp, false); /* needs to be pair move else op is not respected */
vp->op = T_OP_SET;

/*
* Delete any existing SQL-User-Name, and replace it with ours.
*/
fr_pair_delete_by_num(&request->packet->vps, vp->da->attr, vp->da->vendor, TAG_ANY);
fr_pair_add(&request->packet->vps, vp);

return 0;
}
Expand Down

0 comments on commit 8afce71

Please sign in to comment.