From 5c9c8b92249d07bde3fcb216ca00d6bd1a225de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 14 Jul 2016 00:15:38 +0000 Subject: [PATCH] Monitor user can always login in admin with stats credentials This minor patch ensures that Monitor user can access the Admin module with stas credentials --- lib/MySQL_Session.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index abb8170f3..cff4610c4 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -1749,9 +1749,11 @@ void MySQL_Session::handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE( && ( (default_hostgroup<0 && admin==true) || (default_hostgroup>=0 && admin==false) || strncmp(client_myds->myconn->userinfo->username,mysql_thread___monitor_username,strlen(mysql_thread___monitor_username))==0 ) // Do not delete this line. See bug #492 ) { - if (default_hostgroup<0 && admin==true) { - if (default_hostgroup==STATS_HOSTGROUP) { - stats=true; + if (admin==true) { + if ( (default_hostgroup<0) || (strncmp(client_myds->myconn->userinfo->username,mysql_thread___monitor_username,strlen(mysql_thread___monitor_username))==0) ) { + if (default_hostgroup==STATS_HOSTGROUP) { + stats=true; + } } } l_free(pkt->size,pkt->ptr);