Commit 0e388d43 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: add 'const' to password validation API

parent 1cc03e1f
...@@ -42,8 +42,8 @@ struct st_mariadb_password_validation ...@@ -42,8 +42,8 @@ struct st_mariadb_password_validation
Function provided by the plugin which should perform password validation Function provided by the plugin which should perform password validation
and return 0 if the password has passed the validation. and return 0 if the password has passed the validation.
*/ */
int (*validate_password)(MYSQL_CONST_LEX_STRING *username, int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
MYSQL_CONST_LEX_STRING *password); const MYSQL_CONST_LEX_STRING *password);
}; };
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -531,6 +531,6 @@ void thd_wakeup_subsequent_commits(void* thd, int wakeup_error); ...@@ -531,6 +531,6 @@ void thd_wakeup_subsequent_commits(void* thd, int wakeup_error);
struct st_mariadb_password_validation struct st_mariadb_password_validation
{ {
int interface_version; int interface_version;
int (*validate_password)(MYSQL_CONST_LEX_STRING *username, int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
MYSQL_CONST_LEX_STRING *password); const MYSQL_CONST_LEX_STRING *password);
}; };
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
static char *dictionary; static char *dictionary;
static int crackme(MYSQL_CONST_LEX_STRING *username, MYSQL_CONST_LEX_STRING *password) static int crackme(const MYSQL_CONST_LEX_STRING *username,
const MYSQL_CONST_LEX_STRING *password)
{ {
char *user= alloca(username->length + 1); char *user= alloca(username->length + 1);
char *host; char *host;
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
static unsigned min_length, min_digits, min_letters, min_others; static unsigned min_length, min_digits, min_letters, min_others;
static int validate(MYSQL_CONST_LEX_STRING *username, static int validate(const MYSQL_CONST_LEX_STRING *username,
MYSQL_CONST_LEX_STRING *password) const MYSQL_CONST_LEX_STRING *password)
{ {
unsigned digits=0 , uppers=0 , lowers=0, others=0, length= (unsigned)password->length; unsigned digits=0 , uppers=0 , lowers=0, others=0, length= (unsigned)password->length;
const char *ptr= password->str, *end= ptr + length; const char *ptr= password->str, *end= ptr + length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment