From 5b7f9dffbc62a3af2e9663f32c34d27adee319b3 Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Fri, 22 Feb 2019 11:07:19 +0100 Subject: Fix broken support for case-sensitive account names Don't lower account name before calling accounts_get_account(). Only lower if there is no account with the given name and the name is interpreted as a jid. Updated unittests to test this behaviour. Fixes #725 . --- src/command/cmd_funcs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 6cdd40fb..d280e6c8 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -386,12 +386,11 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) } } - char *lower = g_utf8_strdown(user, -1); char *jid; g_free(def); // connect with account - ProfAccount *account = accounts_get_account(lower); + ProfAccount *account = accounts_get_account(user); if (account) { // override account options with connect options if (altdomain != NULL) @@ -414,7 +413,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) account->password = NULL; } else { cons_show("Error evaluating password, see logs for details."); - g_free(lower); + g_free(user); account_free(account); return TRUE; } @@ -432,7 +431,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) // connect with JID } else { - jid = strdup(lower); + jid = g_utf8_strdown(user, -1); char *passwd = ui_ask_password(); conn_status = cl_ev_connect_jid(jid, passwd, altdomain, port, tls_policy); free(passwd); @@ -444,7 +443,6 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) } options_destroy(options); - g_free(lower); free(jid); return TRUE; -- cgit 1.4.1-2-gfad0