]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth-client: auth-master - Improve debug logging in auth_lookup_reply_callback()
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 3 Jun 2020 10:08:48 +0000 (12:08 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 27 Aug 2025 11:37:24 +0000 (13:37 +0200)
src/lib-auth-client/auth-master.c

index 624c93fb6ccacff24d97934fbb938021d72ad5bf..f49e6b4b1d2ad7354f8efc5eccbf02ddfc870182 100644 (file)
@@ -561,6 +561,15 @@ auth_lookup_reply_callback(const struct auth_master_reply *reply, void *context)
                lookup->fields = p_new(lookup->pool, const char *, len + 1);
                for (i = 0; i < len; i++)
                        lookup->fields[i] = p_strdup(lookup->pool, args[i]);
+               if (len == 0) {
+                       e_debug(lookup->event, "auth %s input: (empty)",
+                               lookup->expected_reply);
+               } else {
+                       args = args_hide_passwords(args);
+                       e_debug(lookup->event, "auth %s input: %s",
+                               lookup->expected_reply,
+                               t_strarray_join(args, " "));
+               }
        } else {
                /* put the reason string into first field */
                lookup->fields = p_new(lookup->pool, const char *, 2);
@@ -571,10 +580,14 @@ auth_lookup_reply_callback(const struct auth_master_reply *reply, void *context)
                                break;
                        }
                }
+               if (lookup->fields[0] != NULL) {
+                       e_debug(lookup->event, "auth %s error: %s",
+                               lookup->expected_reply, lookup->fields[0]);
+               } else {
+                       e_debug(lookup->event, "auth %s error: (unknown)",
+                               lookup->expected_reply);
+               }
        }
-       args = args_hide_passwords(args);
-       e_debug(lookup->event, "auth %s input: %s",
-               lookup->expected_reply, t_strarray_join(args, " "));
        return 1;
 }