From: Timo Sirainen Date: Thu, 27 Aug 2020 14:28:38 +0000 (+0300) Subject: auth: Fix compiling gssapi, bsdauth, sia, vpopmail X-Git-Tag: 2.3.13~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50a6a5c0db60c7f71aa76121f9c29212072af40e;p=thirdparty%2Fdovecot%2Fcore.git auth: Fix compiling gssapi, bsdauth, sia, vpopmail Broken by 5ff7299c9d85b1bab0c7d53d9459dbb31a2bd9d6 --- diff --git a/src/auth/mech-gssapi.c b/src/auth/mech-gssapi.c index 966273d388..3594b84fd8 100644 --- a/src/auth/mech-gssapi.c +++ b/src/auth/mech-gssapi.c @@ -154,12 +154,12 @@ obtain_service_credentials(struct auth_request *request, gss_cred_id_t *ret_r) return GSS_S_COMPLETE; } - if (strcasecmp(request->service, "POP3") == 0) { + if (strcasecmp(request->fields.service, "POP3") == 0) { /* The standard POP3 service name with GSSAPI is called just "pop". */ service_name = "pop"; } else { - service_name = t_str_lcase(request->service); + service_name = t_str_lcase(request->fields.service); } principal_name = t_str_new(128); @@ -409,7 +409,7 @@ k5_principal_is_authorized(struct auth_request *request, const char *name) { const char *value, *const *authorized_names, *const *tmp; - value = auth_fields_find(request->extra_fields, "k5principals"); + value = auth_fields_find(request->fields.extra_fields, "k5principals"); if (value == NULL) return FALSE; @@ -536,7 +536,8 @@ mech_gssapi_userok(struct gssapi_auth_request *request, const char *login_user) #else e_info(auth_request->mech_event, "Cross-realm authentication not supported " - "(authn_name=%s, authz_name=%s)", request->auth_request.original_username, login_user); + "(authn_name=%s, authz_name=%s)", + request->auth_request.fields.original_username, login_user); return -1; #endif } @@ -570,7 +571,7 @@ gssapi_credentials_callback(enum passdb_result result, break; } - if (mech_gssapi_userok(gssapi_request, request->user) == 0) + if (mech_gssapi_userok(gssapi_request, request->fields.user) == 0) auth_request_success(request, NULL, 0); else auth_request_fail(request); diff --git a/src/auth/passdb-bsdauth.c b/src/auth/passdb-bsdauth.c index 5889eee1df..36469c679b 100644 --- a/src/auth/passdb-bsdauth.c +++ b/src/auth/passdb-bsdauth.c @@ -23,7 +23,7 @@ bsdauth_verify_plain(struct auth_request *request, const char *password, e_debug(authdb_event(request), "lookup"); - switch (i_getpwnam(request->user, &pw)) { + switch (i_getpwnam(request->fields.user, &pw)) { case -1: e_error(authdb_event(request), "getpwnam() failed: %m"); @@ -36,8 +36,9 @@ bsdauth_verify_plain(struct auth_request *request, const char *password, } /* check if the password is valid */ - type = t_strdup_printf("auth-%s", request->service); - result = auth_userokay(request->user, NULL, t_strdup_noconst(type), + type = t_strdup_printf("auth-%s", request->fields.service); + result = auth_userokay(request->fields.user, NULL, + t_strdup_noconst(type), t_strdup_noconst(password)); /* clear the passwords from memory */ diff --git a/src/auth/passdb-sia.c b/src/auth/passdb-sia.c index ccc18159d8..70f6cefd00 100644 --- a/src/auth/passdb-sia.c +++ b/src/auth/passdb-sia.c @@ -39,7 +39,7 @@ local_sia_verify_plain(struct auth_request *request, const char *password, /* check if the password is valid */ if (sia_validate_user(checkpw_collect, 1, &argutility, NULL, - (char *)request->user, NULL, NULL, NULL, + (char *)request->fields.user, NULL, NULL, NULL, (char *)password) != SIASUCCESS) { auth_request_log_password_mismatch(request, AUTH_SUBSYS_DB); callback(PASSDB_RESULT_PASSWORD_MISMATCH, request); diff --git a/src/auth/passdb-vpopmail.c b/src/auth/passdb-vpopmail.c index 57f90fca0c..f8dc34005e 100644 --- a/src/auth/passdb-vpopmail.c +++ b/src/auth/passdb-vpopmail.c @@ -34,24 +34,24 @@ static bool vpopmail_is_disabled(struct auth_request *request, struct vpopmail_passdb_module *module = (struct vpopmail_passdb_module *)_module; - if (strcasecmp(request->service, "IMAP") == 0) { + if (strcasecmp(request->fields.service, "IMAP") == 0) { if ((vpw->pw_flags & NO_IMAP) != 0) { /* IMAP from webmail IP may still be allowed */ if (!net_ip_compare(&module->webmail_ip, - &request->remote_ip)) + &request->fields.remote_ip)) return TRUE; } if ((vpw->pw_flags & NO_WEBMAIL) != 0) { if (net_ip_compare(&module->webmail_ip, - &request->remote_ip)) + &request->fields.remote_ip)) return TRUE; } } if ((vpw->pw_flags & NO_POP) != 0 && - strcasecmp(request->service, "POP3") == 0) + strcasecmp(request->fields.service, "POP3") == 0) return TRUE; if ((vpw->pw_flags & NO_SMTP) != 0 && - strcasecmp(request->service, "SMTP") == 0) + strcasecmp(request->fields.service, "SMTP") == 0) return TRUE; return FALSE; } @@ -73,7 +73,7 @@ vpopmail_password_lookup(struct auth_request *auth_request, bool *cleartext, if (vpopmail_is_disabled(auth_request, vpw)) { e_info(authdb_event(auth_request), "%s disabled in vpopmail for this user", - auth_request->service); + auth_request->fields.service); password = NULL; *result_r = PASSDB_RESULT_USER_DISABLED; } else { @@ -151,11 +151,11 @@ vpopmail_verify_plain(struct auth_request *request, const char *password, } #ifdef POP_AUTH_OPEN_RELAY - if (strcasecmp(request->service, "POP3") == 0 || - strcasecmp(request->service, "IMAP") == 0) { - const char *host = net_ip2addr(&request->remote_ip); + if (strcasecmp(request->fields.service, "POP3") == 0 || + strcasecmp(request->fields.service, "IMAP") == 0) { + const char *host = net_ip2addr(&request->fields.remote_ip); /* vpopmail 5.4 does not understand IPv6 */ - if (host[0] != '\0' && IPADDR_IS_V4(&request->remote_ip)) { + if (host[0] != '\0' && IPADDR_IS_V4(&request->fields.remote_ip)) { /* use putenv() directly rather than env_put() which would leak memory every time we got here. use a static buffer for putenv() as SUSv2 requirements diff --git a/src/auth/userdb-vpopmail.c b/src/auth/userdb-vpopmail.c index fd6b670ff2..0068ec39f0 100644 --- a/src/auth/userdb-vpopmail.c +++ b/src/auth/userdb-vpopmail.c @@ -29,7 +29,7 @@ struct vqpasswd *vpopmail_lookup_vqp(struct auth_request *request, memset(vpop_user, '\0', VPOPMAIL_LIMIT); memset(vpop_domain, '\0', VPOPMAIL_LIMIT); - if (parse_email(request->user, vpop_user, vpop_domain, + if (parse_email(request->fields.user, vpop_user, vpop_domain, VPOPMAIL_LIMIT-1) < 0) { e_info(authdb_event(request), "parse_email() failed"); @@ -103,10 +103,10 @@ static void vpopmail_lookup(struct auth_request *auth_request, return; } - if (auth_request->successful) { + if (auth_request->fields.successful) { /* update the last login only when we're really */ vset_lastauth(vpop_user, vpop_domain, - t_strdup_noconst(auth_request->service)); + t_strdup_noconst(auth_request->fields.service)); } if (vpw->pw_dir == NULL || vpw->pw_dir[0] == '\0') {