mirror of
https://github.com/MariaDB/server.git
synced 2026-04-20 23:35:32 +02:00
fix the encryption.filekeys_nofile test
and move the error reporting where it belongs
This commit is contained in:
parent
affff1aefc
commit
c4e336e01e
4 changed files with 13 additions and 13 deletions
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#include "parser.h"
|
||||
#include <mysql/plugin_encryption.h>
|
||||
#include <mysqld_error.h>
|
||||
#include <string.h>
|
||||
|
||||
static char* filename;
|
||||
|
|
@ -166,13 +165,6 @@ struct st_mariadb_encryption file_key_management_plugin= {
|
|||
|
||||
static int file_key_management_plugin_init(void *p)
|
||||
{
|
||||
if (!filename || !filename[0])
|
||||
{
|
||||
my_printf_error(ER_CANT_INITIALIZE_UDF,
|
||||
"file_key_management-filename is not set", MYF(0));
|
||||
return 1;
|
||||
}
|
||||
|
||||
Parser parser(filename, filekey);
|
||||
return parser.parse(&keys);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -298,8 +298,16 @@ int Parser::parse_line(char **line_ptr, keyentry *key)
|
|||
|
||||
char* Parser::read_and_decrypt_file(const char *secret)
|
||||
{
|
||||
int f= my_open(filename, O_RDONLY, MYF(MY_WME));
|
||||
if (f < 0)
|
||||
if (!filename || !filename[0])
|
||||
{
|
||||
my_printf_error(EE_CANT_OPEN_STREAM,
|
||||
"file-key-management-filename is not set",
|
||||
MYF(ME_NOREFRESH));
|
||||
goto err0;
|
||||
}
|
||||
|
||||
int f;
|
||||
if ((f= my_open(filename, O_RDONLY, MYF(MY_WME))) < 0)
|
||||
goto err0;
|
||||
|
||||
my_off_t file_size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue