AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/t/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

Anon7 - 2022
AnonSec Team