Skip to content
Browse files

Implements the ability to use ${passwd} inside the SQL query in valid…

…ator_mysql. Credits go to aaronh...@gmail.com.

http://code.google.com/p/cherokee/issues/detail?id=728
  • Loading branch information...
1 parent 4c9c671 commit f61188fa21cd5f204546b8375e405fe1a53c1345 @skinkie committed
Showing with 2 additions and 1 deletion.
  1. +1 −1 admin/plugins/mysql.py
  2. +1 −0 cherokee/validator_mysql.c
View
2 admin/plugins/mysql.py
@@ -38,7 +38,7 @@
NOTE_USER = N_('User name for connecting to the database.')
NOTE_PASSWD = N_('Password for connecting to the database.')
NOTE_DB = N_('Database name containing the user/password pair list.')
-NOTE_SQL = N_('SQL command to execute. ${user} is replaced with the user name.')
+NOTE_SQL = N_('SQL command to execute. ${user} is replaced with the user name and ${passwd} is replaced with the user supplied password.')
NOTE_HASH = N_('Choose an encryption type for the password. Only suitable for the "Basic" authentication mechanism.')
HASHES = [
View
1 cherokee/validator_mysql.c
@@ -260,6 +260,7 @@ cherokee_validator_mysql_check (cherokee_validator_mysql_t *mysql, cherokee_conn
*/
cherokee_buffer_add_buffer (&query, &props->query);
cherokee_buffer_replace_string (&query, "${user}", 7, conn->validator->user.buf, conn->validator->user.len);
+ cherokee_buffer_replace_string (&query, "${passwd}", 9, conn->validator->passwd.buf, conn->validator->passwd.len);
TRACE (ENTRIES, "Query: %s\n", query.buf);

0 comments on commit f61188f

Please sign in to comment.
Something went wrong with that request. Please try again.