]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Start proxying after client fields are set
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Thu, 7 Oct 2021 21:52:47 +0000 (22:52 +0100)
committerSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Mon, 18 Oct 2021 07:47:50 +0000 (08:47 +0100)
Allows adding more event fields in login_proxy_new().

src/login-common/client-common-auth.c

index eac9d48621682ca34b919efbc0bd7dbec2372747..d776083c2bc8d7b9df02edc580a225df7785bf3f 100644 (file)
@@ -508,13 +508,6 @@ static int proxy_start(struct client *client,
                "proxy(%s,%s:%u): ", client->virtual_user,
                net_ip2addr(&proxy_set.ip), proxy_set.port));
 
-       if (login_proxy_new(client, event, &proxy_set, proxy_input,
-                           client->v.proxy_failed) < 0) {
-               event_unref(&event);
-               return -1;
-       }
-       event_unref(&event);
-
        client->proxy_mech = sasl_mech;
        client->proxy_user = i_strdup(reply->destuser);
        client->proxy_master_user = i_strdup(reply->master_user);
@@ -523,6 +516,13 @@ static int proxy_start(struct client *client,
        client->proxy_nopipelining = reply->proxy_nopipelining;
        client->proxy_not_trusted = reply->proxy_not_trusted;
 
+       if (login_proxy_new(client, event, &proxy_set, proxy_input,
+                           client->v.proxy_failed) < 0) {
+               event_unref(&event);
+               return -1;
+       }
+       event_unref(&event);
+
        /* disable input until authentication is finished */
        io_remove(&client->io);
        return 0;