Updated debug log messages

This commit is contained in:
MassimilianoPinto
2014-10-24 16:00:55 +02:00
parent c207b8b990
commit 9eb0e3088b

View File

@ -321,6 +321,7 @@ getDatabases(SERVICE *service, MYSQL *con)
char *get_showdbs_priv_query = LOAD_MYSQL_DATABASE_NAMES; char *get_showdbs_priv_query = LOAD_MYSQL_DATABASE_NAMES;
serviceGetUser(service, &service_user, &service_passwd); serviceGetUser(service, &service_user, &service_passwd);
if (service_user == NULL || service_passwd == NULL) if (service_user == NULL || service_passwd == NULL)
return -1; return -1;
@ -658,8 +659,7 @@ getUsers(SERVICE *service, USERS *users)
LOGFILE_MESSAGE, LOGFILE_MESSAGE,
"Loaded %d MySQL Database Names for service [%s]", "Loaded %d MySQL Database Names for service [%s]",
dbnames, dbnames,
service->name))); else {
} else {
service->resources = NULL; service->resources = NULL;
} }
@ -672,24 +672,25 @@ getUsers(SERVICE *service, USERS *users)
*/ */
int rc = 0; int rc = 0;
char *password; char *password = NULL;
if (row[2] != NULL) { if (row[2] != NULL) {
if (strlen(row[2]) > 1) if (strlen(row[2]) > 1)
password = row[2] +1; password = row[2] +1;
else else
password = row[2]; password = row[2];
} else {
password = strdup("");
} }
/* /*
* add user@host and DB global priv and specificsa grant (if possible) * add user@host and DB global priv and specificsa grant (if possible)
*/ */
if (db_grants) if (db_grants) {
/* we have dbgrants, store them */
rc = add_mysql_users_with_host_ipv4(users, row[0], row[1], password, row[4], row[5]); rc = add_mysql_users_with_host_ipv4(users, row[0], row[1], password, row[4], row[5]);
else } else {
/* we don't have dbgrants, simply set ANY DB for the user */
rc = add_mysql_users_with_host_ipv4(users, row[0], row[1], password, "Y", NULL); rc = add_mysql_users_with_host_ipv4(users, row[0], row[1], password, "Y", NULL);
}
if (rc == 1) { if (rc == 1) {
if (db_grants) { if (db_grants) {