]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fix compiling gssapi, bsdauth, sia, vpopmail
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 27 Aug 2020 14:28:38 +0000 (17:28 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 28 Aug 2020 08:32:31 +0000 (11:32 +0300)
Broken by 5ff7299c9d85b1bab0c7d53d9459dbb31a2bd9d6

src/auth/mech-gssapi.c
src/auth/passdb-bsdauth.c
src/auth/passdb-sia.c
src/auth/passdb-vpopmail.c
src/auth/userdb-vpopmail.c

index 966273d3889736595f82d9386e2a3afcfdee1e29..3594b84fd83d2eadfb9821d6f22862ece8d51bcd 100644 (file)
@@ -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);
index 5889eee1df0cfc1f7b75b8b8a76f0ae47eab5700..36469c679b827a32bae4d45ea10b471268e521cc 100644 (file)
@@ -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 */
index ccc18159d8c58cc781db9b276732165e8ef6b7c7..70f6cefd00c386799472ebcc57d298dbc5ec38ad 100644 (file)
@@ -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);
index 57f90fca0c25fc26c53083170504617c18cb9967..f8dc34005eb57b10d9ee3236cc7409c7c37aa16b 100644 (file)
@@ -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
index fd6b670ff2f4af7b59cf4c4be2f7c687aa511c84..0068ec39f0046dcba3b179f694694e7080336110 100644 (file)
@@ -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') {