From ff26007634f8a1c5d7b9f9e06dbd990e66ea5f6a Mon Sep 17 00:00:00 2001 From: tobhe Date: Tue, 24 Mar 2020 13:32:37 +0000 Subject: Fix user database corruption from 'ikectl reload'. Copy only the new password instead of the full iked_user struct to preserve the RB_TREE pointers. From Bernardo Cunha Vieira ok patrick@ --- sbin/iked/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/iked/config.c b/sbin/iked/config.c index 13bf476f26f..bc89c61c0ff 100644 --- a/sbin/iked/config.c +++ b/sbin/iked/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.54 2020/03/09 11:50:43 tobhe Exp $ */ +/* $OpenBSD: config.c,v 1.55 2020/03/24 13:32:36 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -434,7 +434,7 @@ config_new_user(struct iked *env, struct iked_user *new) if ((old = RB_INSERT(iked_users, &env->sc_users, usr)) != NULL) { /* Update the password of an existing user*/ - memcpy(old, new, sizeof(*old)); + memcpy(old->usr_pass, new->usr_pass, IKED_PASSWORD_SIZE); log_debug("%s: updating user %s", __func__, usr->usr_name); free(usr); -- cgit v1.2.3