diff options
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 | ||||
-rw-r--r-- | plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc | 6 | ||||
-rw-r--r-- | plugin/password_reuse_check/password_reuse_check.c | 2 |
5 files changed, 15 insertions, 11 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; } diff --git a/plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc b/plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc index 730707ff52b..7c72af688e4 100644 --- a/plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc +++ b/plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc @@ -13,12 +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_encryption.h> #include <mysqld_error.h> #include <string.h> -#include <stdlib.h> -#include <limits.h> -#include <time.h> #include <errno.h> #include <string> #include <sstream> @@ -26,8 +24,6 @@ #ifdef _WIN32 #include <malloc.h> #define alloca _alloca -#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) -#include <alloca.h> #endif #include <algorithm> #include <unordered_map> diff --git a/plugin/password_reuse_check/password_reuse_check.c b/plugin/password_reuse_check/password_reuse_check.c index e65b724022d..47c9b4531a8 100644 --- a/plugin/password_reuse_check/password_reuse_check.c +++ b/plugin/password_reuse_check/password_reuse_check.c @@ -257,6 +257,6 @@ maria_declare_plugin(password_reuse_check) NULL, sysvars, "2.0", - MariaDB_PLUGIN_MATURITY_GAMMA + MariaDB_PLUGIN_MATURITY_STABLE } maria_declare_plugin_end; |