summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/ugids-verify-auth.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-12-01 16:03:15 +0000
committerRoland McGrath <roland@gnu.org>1998-12-01 16:03:15 +0000
commitfad7e8335b92350f016f27c5b93053797452a308 (patch)
tree24ad3f757bca6589ceb20c1980d28f5632f7e7d7 /libshouldbeinlibc/ugids-verify-auth.c
parent52c4c2f0dc0892ee606df12990c93b62b653fd32 (diff)
1998-11-30 Mark Kettenis <kettenis@phys.uva.nl>
* 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.
Diffstat (limited to 'libshouldbeinlibc/ugids-verify-auth.c')
-rw-r--r--libshouldbeinlibc/ugids-verify-auth.c8
1 files changed, 5 insertions, 3 deletions
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)