diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-10-29 19:22:04 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-10-29 19:22:04 +0200 |
commit | 1ebfa2af62246b98e17cd255a9ccd858151b355a (patch) | |
tree | f9cf4670ebe96b46f8e0107acc31f7235ec4c554 /plugin | |
parent | dd9da61dcfd7f5e675ed876cf38886b29d0ddc57 (diff) | |
parent | 64143741789a3e1c2bb8c6bf627eaec3751af0c6 (diff) | |
download | mariadb-git-1ebfa2af62246b98e17cd255a9ccd858151b355a.tar.gz |
Merge branch '10.6' into 10.7
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/cracklib_password_check/cracklib_password_check.c | 2 | ||||
-rw-r--r-- | plugin/feedback/feedback.cc | 1 | ||||
-rw-r--r-- | plugin/file_key_management/parser.cc | 15 |
3 files changed, 13 insertions, 5 deletions
diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c index 95f8e11fe0e..9568f84a03b 100644 --- a/plugin/cracklib_password_check/cracklib_password_check.c +++ b/plugin/cracklib_password_check/cracklib_password_check.c @@ -13,10 +13,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ +#include <my_global.h> #include <mysql/plugin_password_validation.h> #include <crack.h> #include <string.h> -#include <alloca.h> #include <mysqld_error.h> static char *dictionary; diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc index 3b2e95f1e13..cb254d69ec3 100644 --- a/plugin/feedback/feedback.cc +++ b/plugin/feedback/feedback.cc @@ -102,7 +102,6 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter) if (!filter->str || !nrc) return 0; - nrc->init(); nrc->resolve_in_table_list_only(tables); nrc->select_lex= tables->select_lex; diff --git a/plugin/file_key_management/parser.cc b/plugin/file_key_management/parser.cc index 818c026495f..57e0139a57d 100644 --- a/plugin/file_key_management/parser.cc +++ b/plugin/file_key_management/parser.cc @@ -162,19 +162,28 @@ bool Parser::read_filekey(const char *filekey, char *secret) int f= open(filekey, O_RDONLY|O_BINARY); if (f == -1) { - my_error(EE_FILENOTFOUND,ME_ERROR_LOG, filekey, errno); + my_error(EE_FILENOTFOUND, ME_ERROR_LOG, filekey, errno); return 1; } - int len= read(f, secret, MAX_SECRET_SIZE); + int len= read(f, secret, MAX_SECRET_SIZE + 1); if (len <= 0) { - my_error(EE_READ,ME_ERROR_LOG, filekey, errno); + my_error(EE_READ, ME_ERROR_LOG, filekey, errno); close(f); return 1; } close(f); + while (secret[len - 1] == '\r' || secret[len - 1] == '\n') len--; + if (len > MAX_SECRET_SIZE) + { + my_printf_error(EE_READ, + "Cannot read %s, the filekey is too long, " + "max secret size is %dB ", + ME_ERROR_LOG, filekey, MAX_SECRET_SIZE); + return 1; + } secret[len]= '\0'; return 0; } |