Branch updated from develop

Branch updated from develop
This commit is contained in:
MassimilianoPinto 2014-02-28 17:36:48 +01:00
commit bc31ac2ed3
3 changed files with 21 additions and 17 deletions

View File

@ -157,20 +157,20 @@ struct users *newusers, *oldusers;
static int
getUsers(SERVICE *service, struct users *users)
{
MYSQL *con = NULL;
MYSQL_ROW row;
MYSQL_RES *result = NULL;
int num_fields = 0;
char *service_user = NULL;
char *service_passwd = NULL;
char *dpwd;
int total_users = 0;
SERVER *server;
char *users_query;
unsigned char hash[SHA_DIGEST_LENGTH]="";
char *users_data = NULL;
int nusers = 0;
int users_data_row_len = MYSQL_USER_MAXLEN + MYSQL_HOST_MAXLEN + MYSQL_PASSWORD_LEN + 1;
MYSQL *con = NULL;
MYSQL_ROW row;
MYSQL_RES *result = NULL;
int num_fields = 0;
char *service_user = NULL;
char *service_passwd = NULL;
char *dpwd;
int total_users = 0;
SERVER *server;
char *users_query;
unsigned char hash[SHA_DIGEST_LENGTH]="";
char *users_data = NULL;
int nusers = 0;
int users_data_row_len = MYSQL_USER_MAXLEN + MYSQL_HOST_MAXLEN + MYSQL_PASSWORD_LEN + 1;
struct sockaddr_in serv_addr;
MYSQL_USER_HOST key;
@ -317,6 +317,9 @@ getUsers(SERVICE *service, struct users *users)
char ret_ip[INET_ADDRSTRLEN + 1]="";
const char *rc;
char ret_ip[INET_ADDRSTRLEN + 1]="";
const char *rc;
/* prepare the user@host data struct */
memset(&serv_addr, 0, sizeof(serv_addr));
memset(&key, 0, sizeof(key));
@ -350,7 +353,7 @@ getUsers(SERVICE *service, struct users *users)
row[1],
rc == NULL ? "NULL" : ret_ip)));
strncat(users_data, row[2], users_data_row_len);
strncat(users_data, row[3], users_data_row_len);
total_users++;
} else {

View File

@ -17,7 +17,9 @@
*
* Copyright SkySQL Ab 2013
*/
#include <service.h>
#include <arpa/inet.h>
/**

View File

@ -30,10 +30,9 @@
*
* Date Who Description
* 23/06/13 Mark Riddoch Initial implementation
* 14/02/14 Massimiliano Pinto Added usersCustomUserFormat, optional username format routine
* 21/02/14 Massimiliano Pinto Added USERS_HASHTABLE_SIZE
* 26/02/14 Massimiliano Pinto Added checksum to users' table with SHA1
* 27/02/14 Massimiliano Pinto Added USERS_HASHTABLE_DEFAULT_SIZE
* 28/02/14 Massimiliano Pinto Added usersCustomUserFormat, optional username format routine
*
* @endverbatim
*/