[Greater-commits] r311 - trunk/GREAT-ER-DB/impl/postgresql
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jun 29 17:18:57 CEST 2011
Author: bricks
Date: 2011-06-29 17:18:56 +0200 (Wed, 29 Jun 2011)
New Revision: 311
Modified:
trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Save user_id in lowercase letters in lgda_set_connection_values function
Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-29 15:15:48 UTC (rev 310)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-29 15:18:56 UTC (rev 311)
@@ -3935,18 +3935,18 @@
\return DA_SUCCESS \n DA_FAIL.
*/
-int lgda_set_connection_values(DB_con *db_con,
- char *vp_db_descr,
- char *vp_username,
+int lgda_set_connection_values(DB_con *db_con,
+ char *vp_db_descr,
+ char *vp_username,
char *vp_password,
- DA_T_errinfo *vp_errinfo)
+ DA_T_errinfo *vp_errinfo)
{
// not used: DA_T_MODULE_NAME v_module = "lgda_set_connection_values";
/* connection_target must be of the form: dbname at host:port, *
- * dbname at host or dbname */
+ * dbname at host or dbname */
char *aet = "@";
char *dp = ":";
@@ -3966,53 +3966,53 @@
copy = (char *)malloc(600 * sizeof(char));
if(copy == NULL)
- return DA_FAIL;
+ return DA_FAIL;
strcpy (copy, db_con->connection_target);
if ((pos = strstr(copy,aet)) != NULL)
{
- if((dbname = strtok(copy, aet)) != NULL)
- {
- db_con->db_name = (char *)malloc(50 * sizeof(char));
- strcpy(db_con->db_name, dbname);
- if((host = strtok(NULL, dp)) != NULL)
- {
- db_con->host = (char *)malloc(500 * sizeof(char));
- strcpy(db_con->host, host);
- if((port = strtok(NULL,dp)) != NULL)
- {
- db_con->port = (char *)malloc(50 * sizeof(char));
- strcpy(db_con->port, port);
- }
- else
- db_con->port = NULL;
- }
- else
- {
- host = strtok(NULL,"");
- strcpy(db_con->host, host);
- db_con->port = NULL;
- }
- }
- }
+ if((dbname = strtok(copy, aet)) != NULL)
+ {
+ db_con->db_name = (char *)malloc(50 * sizeof(char));
+ strcpy(db_con->db_name, dbname);
+ if((host = strtok(NULL, dp)) != NULL)
+ {
+ db_con->host = (char *)malloc(500 * sizeof(char));
+ strcpy(db_con->host, host);
+ if((port = strtok(NULL,dp)) != NULL)
+ {
+ db_con->port = (char *)malloc(50 * sizeof(char));
+ strcpy(db_con->port, port);
+ }
+ else
+ db_con->port = NULL;
+ }
+ else
+ {
+ host = strtok(NULL,"");
+ strcpy(db_con->host, host);
+ db_con->port = NULL;
+ }
+ }
+ }
else
{
- db_con->db_name = (char *)malloc(50 * sizeof(char));
- strcpy(db_con->db_name, vp_db_descr);
- db_con->host = NULL;
- db_con->port = NULL;
+ db_con->db_name = (char *)malloc(50 * sizeof(char));
+ strcpy(db_con->db_name, vp_db_descr);
+ db_con->host = NULL;
+ db_con->port = NULL;
}
- db_con->user_id = (char *)malloc(20 * sizeof(char));
- strcpy(db_con->user_id, vp_username);
- db_con->user_passwd = (char *)malloc(20 * sizeof(char));
+ db_con->user_id = (char *)malloc(31 * sizeof(char));
+ lda_strtolower(db_con->user_id, vp_username);
+ db_con->user_passwd = (char *)malloc(31 * sizeof(char));
strcpy(db_con->user_passwd, vp_password);
db_con->con_name = (char *)malloc(20 * sizeof(char));
strcpy(db_con->con_name, "conn");
free(copy);
- return (DA_SUCCESS);
+ return (DA_SUCCESS);
}
More information about the Greater-commits
mailing list