[Greater-commits] r330 - trunk/GREAT-ER-DB/impl/postgresql

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 30 14:07:33 CEST 2011


Author: bricks
Date: 2011-06-30 14:07:31 +0200 (Thu, 30 Jun 2011)
New Revision: 330

Modified:
   trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
While connecting check if the user_id contains invalid characters


Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc	2011-06-30 12:06:19 UTC (rev 329)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc	2011-06-30 12:07:31 UTC (rev 330)
@@ -4108,6 +4108,12 @@
   if(!db_con)
     return NULL;
 
+  if (!lgda_check_username(vp_userid)) {
+    vp_errinfo->err_type = DA_ERRTYP_PG;
+    vp_errinfo->err_no   = DA_ERR_INVALID_USERNAME;
+    sprintf(vp_errinfo->err_param, "%s - invalid username. (%s)", v_module, vp_userid);
+    return NULL;
+  }
 
   lgda_set_connection_values(db_con, vp_connect_descr, 
                              vp_userid, vp_passwd, vp_errinfo);



More information about the Greater-commits mailing list