From fad7e8335b92350f016f27c5b93053797452a308 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 1 Dec 1998 16:03:15 +0000 Subject: 1998-11-30 Mark Kettenis * ugids-verify-auth.c (svma_state_add_auths): Allocate correct number of bytes for new auth port array. (server_verify_make_auth): Set check to password_check_group if is_group is true and to password_check_user if not. Not the other way around. --- libshouldbeinlibc/ugids-verify-auth.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libshouldbeinlibc/ugids-verify-auth.c') diff --git a/libshouldbeinlibc/ugids-verify-auth.c b/libshouldbeinlibc/ugids-verify-auth.c index 187a526c..000e4126 100644 --- a/libshouldbeinlibc/ugids-verify-auth.c +++ b/libshouldbeinlibc/ugids-verify-auth.c @@ -64,9 +64,11 @@ struct svma_state /* Append the auth ports in AUTHS, of length NUM_AUTHS, to the auth port vector in SS, returning 0 if successful, or an error. */ static error_t -svma_state_add_auths (struct svma_state *ss, const auth_t *auths, size_t num_auths) +svma_state_add_auths (struct svma_state *ss, + const auth_t *auths, size_t num_auths) { - auth_t *new = realloc (ss->auths, ss->num_auths + num_auths); + auth_t *new = realloc (ss->auths, + (ss->num_auths + num_auths) * sizeof (auth_t)); if (new) { ss->auths = new; @@ -87,7 +89,7 @@ server_verify_make_auth (const char *password, auth_t auth; struct svma_state *svma_state = hook; error_t (*check) (io_t server, uid_t id, const char *passwd, auth_t *auth) = - is_group ? password_check_user : password_check_group; + is_group ? password_check_group : password_check_user; error_t err = (*check) (svma_state->server, id, password, &auth); if (! err) -- cgit v1.2.3