Skip to content

Commit 95a9dbb

Browse files
author
Robert Golebiowski
committed
Bug #23498254: KEYRING_FILE SHOULD NOT DUMP ITS CONTENT WHEN KEYRING
FILE IS NOT AVAILABLE - fix for 5.7 based on file's stat fix for test gr_key_rotation
1 parent 15321ab commit 95a9dbb

File tree

10 files changed

+26
-10
lines changed

10 files changed

+26
-10
lines changed

mysql-test/suite/auth_sec/r/install_keyring_file.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call mtr.add_suppression("keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided");
22
call mtr.add_suppression("Could not create keyring directory The keyring_file will stay unusable until correct path to the keyring directory gets provided");
33
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
4-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
4+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
55
SET @@global.keyring_file_data= 'MYSQL_TMP_DIR/new_keyring_file';
66
ERROR HY000: Unknown system variable 'keyring_file_data'
77
INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';

mysql-test/suite/auth_sec/r/keyring_file_data.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
call mtr.add_suppression("keyring_file_data cannot be set to new value as the keyring file cannot be created/accessed in the provided path");
22
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
3-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
3+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
4+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/bad_keyring_file_data/' not found .*");
45
SELECT @@global.keyring_file_data;
56
@@global.keyring_file_data
67
MYSQL_TMP_DIR/mysecret_keyring

mysql-test/suite/auth_sec/r/keyring_file_data_qa.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ call mtr.add_suppression("keyring_file_data cannot be set to new value as the ke
44
call mtr.add_suppression("\\[Error\\] Plugin keyring_file reported: 'keyring_file initialization failure.");
55
call mtr.add_suppression("Plugin keyring_file reported: 'Could not create keyring directory The keyring_file will stay unusable until correct path to the keyring directory gets provided");
66
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
7-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
7+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
8+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File 'MYSQL_test_invalid/dir/' not found .*");
9+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File '/' not found .*");
810
INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
911
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS
1012
FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';

mysql-test/suite/auth_sec/t/install_keyring_file.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
call mtr.add_suppression("keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided");
66
call mtr.add_suppression("Could not create keyring directory The keyring_file will stay unusable until correct path to the keyring directory gets provided");
77
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
8-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
8+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
99

1010

1111
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR

mysql-test/suite/auth_sec/t/keyring_file_data.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
call mtr.add_suppression("keyring_file_data cannot be set to new value as the keyring file cannot be created/accessed in the provided path");
66
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
7-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
7+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
8+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/bad_keyring_file_data/' not found .*");
89

910
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
1011
SELECT @@global.keyring_file_data;

mysql-test/suite/auth_sec/t/keyring_file_data_qa.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ call mtr.add_suppression("keyring_file_data cannot be set to new value as the ke
1010
call mtr.add_suppression("\\[Error\\] Plugin keyring_file reported: 'keyring_file initialization failure.");
1111
call mtr.add_suppression("Plugin keyring_file reported: 'Could not create keyring directory The keyring_file will stay unusable until correct path to the keyring directory gets provided");
1212
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
13-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
13+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
14+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File 'MYSQL_test_invalid/dir/' not found .*");
15+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File '/' not found .*");
1416

1517
# Installing keyring plugin.
1618
--replace_regex /\.dll/.so/

mysql-test/suite/innodb/r/table_encrypt_5.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ call mtr.add_suppression("\\[Warning\\] InnoDB: Please refer to .* for how to re
1313
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
1414
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'Could not create keyring directory");
1515
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'keyring_file initialization failure.");
16-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
16+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
1717
# Starting server with keyring plugin
1818
# restart: --early-plugin-load=keyring_file=keyring_file.so --loose-keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring --plugin-dir=KEYRING_PLUGIN_PATH
1919
DROP DATABASE IF EXISTS tde_db;

mysql-test/suite/innodb/t/table_encrypt_5.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ call mtr.add_suppression("\\[Warning\\] InnoDB: Please refer to .* for how to re
3333
call mtr.add_suppression("Error while loading keyring content. The keyring might be malformed");
3434
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'Could not create keyring directory");
3535
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'keyring_file initialization failure.");
36-
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File");
36+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
3737

3838
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
3939

rapid/plugin/group_replication/tests/mtr/r/gr_key_rotation.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set sql_log_bin=0;
77
call mtr.add_suppression("\\[Error\\] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded.");
88
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'Error while loading keyring content*");
99
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'keyring_file initialization failure.*");
10+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
1011
set sql_log_bin=1;
1112
ALTER INSTANCE ROTATE INNODB MASTER KEY;
1213
ERROR HY000: Can't find master key from keyring, please check keyring plugin is loaded.
@@ -38,6 +39,7 @@ call mtr.add_suppression("\\[Error\\] Plugin group_replication reported: 'The se
3839
call mtr.add_suppression("\\[Warning\\] Plugin group_replication reported: 'Skipping leave operation:*");
3940
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'Error while loading keyring content*");
4041
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'keyring_file initialization failure.*");
42+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
4143
call mtr.add_suppression("\\[Error\\] Plugin group_replication reported: 'Message received while the plugin is not ready, message discarded'*");
4244
set sql_log_bin=1;
4345
ALTER INSTANCE ROTATE INNODB MASTER KEY;

rapid/plugin/group_replication/tests/mtr/t/gr_key_rotation.test

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# 3. Clean Up.
1818
###############################################################################
1919

20-
--let plugins = KEYRING_PLUGIN,GROUP_REPLICATION
21-
--source include/check_plugin_dir.inc
20+
#--let plugins = KEYRING_PLUGIN,GROUP_REPLICATION
21+
#--source include/check_plugin_dir.inc
2222

2323
--source ../inc/have_group_replication_plugin.inc
2424
--let $rpl_skip_group_replication_start= 1
@@ -28,6 +28,7 @@ set sql_log_bin=0;
2828
call mtr.add_suppression("\\[Error\\] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded.");
2929
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'Error while loading keyring content*");
3030
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'keyring_file initialization failure.*");
31+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
3132
set sql_log_bin=1;
3233

3334
# Scenario 1
@@ -37,8 +38,10 @@ set sql_log_bin=1;
3738
ALTER INSTANCE ROTATE INNODB MASTER KEY;
3839

3940
# Install keyring plugin on server1
41+
--disable_warnings
4042
--replace_regex /\.dll/.so/
4143
--eval INSTALL PLUGIN keyring_file SONAME '$KEYRING_PLUGIN'
44+
--enable_warnings
4245
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
4346
--eval SET @@global.keyring_file_data='$MYSQL_TMP_DIR/keyring_server1/keyring_server1'
4447
--query_vertical SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file'
@@ -74,6 +77,7 @@ call mtr.add_suppression("\\[Error\\] Plugin group_replication reported: 'The se
7477
call mtr.add_suppression("\\[Warning\\] Plugin group_replication reported: 'Skipping leave operation:*");
7578
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'Error while loading keyring content*");
7679
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'keyring_file initialization failure.*");
80+
call mtr.add_suppression("\\[ERROR\\] Plugin keyring_file reported: 'File .*/keyring' not found .*");
7781
call mtr.add_suppression("\\[Error\\] Plugin group_replication reported: 'Message received while the plugin is not ready, message discarded'*");
7882
set sql_log_bin=1;
7983

@@ -82,8 +86,10 @@ set sql_log_bin=1;
8286
ALTER INSTANCE ROTATE INNODB MASTER KEY;
8387

8488
# Install keyring plugin on server2
89+
--disable_warnings
8590
--replace_regex /\.dll/.so/
8691
--eval INSTALL PLUGIN keyring_file SONAME '$KEYRING_PLUGIN'
92+
--enable_warnings
8793
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
8894
--eval SET @@global.keyring_file_data='$MYSQL_TMP_DIR/keyring_server2/keyring_server2'
8995
--query_vertical SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file'
@@ -138,8 +144,10 @@ SELECT * FROM t3;
138144
--source include/stop_group_replication.inc
139145

140146
# Install plugin on server2 and start GR
147+
--disable_warnings
141148
--replace_regex /\.dll/.so/
142149
--eval INSTALL PLUGIN keyring_file SONAME '$KEYRING_PLUGIN'
150+
--enable_warnings
143151
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
144152
--eval SET @@global.keyring_file_data='$MYSQL_TMP_DIR/keyring_server2/keyring_server2'
145153
--query_vertical SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file'

0 commit comments

Comments
 (0)