diff --git a/server/core/dbusers.c b/server/core/dbusers.c index f79193226..63055934f 100644 --- a/server/core/dbusers.c +++ b/server/core/dbusers.c @@ -2397,14 +2397,18 @@ bool check_service_permissions(SERVICE* service) if(mysql_real_connect(mysql,server->server->name,user,dpasswd,NULL,server->server->port,NULL,0) == NULL) { skygw_log_write(LE,"%s: Error: Failed to connect to server %s(%s:%d) when" - " checking authentication user credentials and permissions.", + " checking authentication user credentials and permissions: %d %s", service->name, server->server->unique_name, server->server->name, - server->server->port); + server->server->port, + mysql_errno(mysql), + mysql_error(mysql)); mysql_close(mysql); free(dpasswd); - return false; + + /** We don't know enough about user permissions */ + return true; } if(mysql_query(mysql,"SELECT user, host, password,Select_priv FROM mysql.user limit 1") != 0) @@ -2414,6 +2418,7 @@ bool check_service_permissions(SERVICE* service) skygw_log_write(LE,"%s: Error: User '%s' is missing SELECT privileges" " on mysql.user table. MySQL error message: %s", service->name,user,mysql_error(mysql)); + rval = false; } else { @@ -2421,7 +2426,6 @@ bool check_service_permissions(SERVICE* service) " MySQL error message: %s", service->name,mysql_error(mysql)); } - rval = false; } else { @@ -2432,9 +2436,8 @@ bool check_service_permissions(SERVICE* service) service->name,mysql_error(mysql)); mysql_close(mysql); free(dpasswd); - return false; + return true; } - mysql_free_result(res); } if(mysql_query(mysql,"SELECT user, host, db FROM mysql.db limit 1") != 0) @@ -2443,13 +2446,13 @@ bool check_service_permissions(SERVICE* service) { skygw_log_write(LE,"%s: Error: User '%s' is missing SELECT privileges on mysql.db table. MySQL error message: %s", service->name,user,mysql_error(mysql)); + rval = false; } else { skygw_log_write(LE,"%s: Error: Failed to query from mysql.db table. MySQL error message: %s", service->name,mysql_error(mysql)); } - rval = false; } else { @@ -2457,7 +2460,6 @@ bool check_service_permissions(SERVICE* service) { skygw_log_write(LE,"%s: Error: Result retrieval failed when checking for permissions to the mysql.db table: %s", service->name,mysql_error(mysql)); - rval = false; } else { diff --git a/server/core/service.c b/server/core/service.c index a281db608..bc534f6b7 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -235,11 +235,11 @@ GWPROTOCOL *funcs; { LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR, - "Error : Unable to load users from %s:%d for " - "service %s.", + "Error : Unable to load users for " + "service %s listening at %s:%d.", + service->name, (port->address == NULL ? "0.0.0.0" : port->address), - port->port, - service->name))); + port->port))); { /* Try loading authentication data from file cache */