⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
t
/
View File Name :
mysql_upgrade_with_session_user.test
# ==== Purpose ==== # # This test intends to test that the MySQL upgrade process will create the # default user for the server session service. # If such a user already exists we test to see if it has the valid privileges # # ==== Implementation ==== # # 1) Delete the user. See that MySQL upgrade re-creates it # 2) Remove the user Super privileges, The MySQL upgrade process errors out. # 3) Remove the user Select privileges on performance schema. Again an error # 4) Clean up # # ==== References ==== # # Bug#25642343: THE SERVER SHOULD HAVE A DEFAULT USER FOR THE SERVER SESION SERVICE # -- source include/no_valgrind_without_big.inc -- source include/mysql_upgrade_preparation.inc let $date_to_restore=`SELECT password_last_changed from mysql.user where user='mysql.session'`; let $date_to_restore_priv=`SELECT timestamp from mysql.tables_priv where user='mysql.session'`; --echo # --echo # Delete the user --echo # Check that upgrade recreates it --echo # DELETE FROM mysql.user WHERE user='mysql.session'; --echo Run mysql_upgrade --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 --let $assert_text= The session user should exist after upgrade --let $assert_cond= "[SELECT COUNT(*) FROM mysql.user WHERE user=\'mysql.session\']" = 1 --source include/assert.inc --echo # --echo # Change some user privileges, making it invalid --echo # # No super privileges UPDATE mysql.user SET Super_priv ='N' WHERE USER= 'mysql.session'; --echo Run mysql_upgrade --error 5 --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 UPDATE mysql.user SET Super_priv ='Y' WHERE USER= 'mysql.session'; # No privileges on performance schema UPDATE mysql.tables_priv SET Table_priv ='' WHERE USER= 'mysql.session'; --echo Run mysql_upgrade --error 5 --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 --echo # --echo # Clean up --echo # UPDATE mysql.tables_priv SET Table_priv ='Select' WHERE USER= 'mysql.session'; --disable_query_log ONCE --eval UPDATE mysql.tables_priv SET timestamp ='$date_to_restore_priv' WHERE USER= 'mysql.session' --disable_query_log ONCE --eval UPDATE mysql.user SET password_last_changed= '$date_to_restore' WHERE USER= 'mysql.session' --source include/mysql_upgrade_cleanup.inc --echo --echo End of tests