]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login: Show empty username in disconnect message.
authorTimo Sirainen <tss@iki.fi>
Sat, 19 Nov 2011 21:15:19 +0000 (23:15 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 19 Nov 2011 21:15:19 +0000 (23:15 +0200)
src/login-common/client-common.c

index 7007f70bee4b3306ef6b94a1c1c56d29d7653ff9..fa35c9f1887c5083a4f71a9b0d6f84c707d534dd 100644 (file)
@@ -416,8 +416,12 @@ static bool have_key(const struct var_expand_table *table, const char *str)
        key = var_get_key(str);
        for (i = 0; table[i].key != '\0'; i++) {
                if (table[i].key == key) {
-                       return table[i].value != NULL &&
-                               table[i].value[0] != '\0';
+                       if (table[i].value == NULL)
+                               return FALSE;
+                       if (table[i].value[0] != '\0')
+                               return TRUE;
+                       /* "" key - hide except in username */
+                       return key == 'u' || key == 'n';
                }
        }
        return FALSE;