From 34ccd8b19c99b29b07d4d76d3bce5e3c84464c6e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 15 Jun 2017 19:30:49 -0700 Subject: [PATCH] client: bug fix in acct mgr logic --- client/acct_mgr.cpp | 1 + client/gui_rpc_server_ops.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/acct_mgr.cpp b/client/acct_mgr.cpp index d6a6d8a388..1064b75124 100644 --- a/client/acct_mgr.cpp +++ b/client/acct_mgr.cpp @@ -65,6 +65,7 @@ int ACCT_MGR_OP::do_rpc( strlcpy(url, _url.c_str(), sizeof(url)); error_num = ERR_IN_PROGRESS; + error_str = ""; via_gui = _via_gui; if (global_prefs_xml) { free(global_prefs_xml); diff --git a/client/gui_rpc_server_ops.cpp b/client/gui_rpc_server_ops.cpp index 40be183a02..8d6d12eac8 100644 --- a/client/gui_rpc_server_ops.cpp +++ b/client/gui_rpc_server_ops.cpp @@ -979,7 +979,10 @@ static void handle_acct_mgr_rpc(GUI_RPC_CONN& grc) { } if (bad_arg) { grc.mfout.printf("bad arg\n"); - } else if (!gstate.acct_mgr_info.same_am(url.c_str(), name.c_str(), password_hash.c_str())) { + } else if (gstate.acct_mgr_info.using_am() + && !url.empty() + && !gstate.acct_mgr_info.same_am(url.c_str(), name.c_str(), password_hash.c_str()) + ){ grc.mfout.printf("attached to a different AM - detach first\n"); } else { gstate.acct_mgr_op.do_rpc(url, name, password_hash, true);