Skip to content

Commit cb5a836

Browse files
committed
warn if the secret changes
1 parent bc7be92 commit cb5a836

File tree

1 file changed

+10
-0
lines changed
  • src/modules/rlm_radius

1 file changed

+10
-0
lines changed

src/modules/rlm_radius/bio.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,6 +2719,16 @@ static xlat_action_t xlat_radius_client(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcurso
27192719
fr_time_t now = fr_time();
27202720
home_server_t *old;
27212721

2722+
/*
2723+
* We can't change secrets on the fly. The home
2724+
* server has to expire first, and then the
2725+
* secret can be changed.
2726+
*/
2727+
if ((home->ctx.radius_ctx.secret_length != secret->vb_length) ||
2728+
(strcmp(home->ctx.radius_ctx.secret, secret->vb_strvalue) != 0)) {
2729+
RWDEBUG("The new secret is not the same as the old secret: Ignoring the new one");
2730+
}
2731+
27222732
fr_rb_expire_update(expire, home, now);
27232733

27242734
while ((old = fr_dlist_head(&expire->head)) != NULL) {

0 commit comments

Comments
 (0)