[Greater-commits] r328 - trunk/GREAT-ER-DB/impl/postgresql
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jun 30 14:04:53 CEST 2011
Author: bricks
Date: 2011-06-30 14:04:52 +0200 (Thu, 30 Jun 2011)
New Revision: 328
Modified:
trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Add function to check a user_id for invalid characters
Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-30 10:53:10 UTC (rev 327)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-30 12:04:52 UTC (rev 328)
@@ -109,6 +109,20 @@
void lda_strtolower(char * dest, const char *source) {
lda_strntolower(dest, source, strlen(source));
}
+
+int lgda_check_username(const char * user_id) {
+ int i;
+
+ for (i=0; i < strlen(user_id); i++) {
+ if (isspace(user_id[i])) {
+ return 0;
+ }
+ if (!isascii(user_id[i])) {
+ return 0;
+ }
+ }
+ return 1;
+}
/*********************************************************************
* Name : lda_init_debug_info
*
@@ -4094,6 +4108,7 @@
if(!db_con)
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