diff options
author | tobhe <tobhe@cvs.openbsd.org> | 2020-03-24 13:32:37 +0000 |
---|---|---|
committer | tobhe <tobhe@cvs.openbsd.org> | 2020-03-24 13:32:37 +0000 |
commit | ff26007634f8a1c5d7b9f9e06dbd990e66ea5f6a (patch) | |
tree | edbca01d72f9699cc2aaf97a885cd80f8a4820e7 | |
parent | a94e1240728299c37baa5cef021bdea2686b63bc (diff) |
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 <bernardo (dot) vieira (at) almg (dot) gov (dot) br>
ok patrick@
-rw-r--r-- | sbin/iked/config.c | 4 |
1 files 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 <tobias.heider@stusta.de> @@ -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); |