403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/main/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/main/master_info_numeric_validation.test
#
# MDEV-38010: Trailing garbage in master.info numeric fields leads to corruption.
# This test verifis that the server strictly validates numeric lines in master.info.
# If trailing non-whitespace characters are found, the line is rejected as corrupted.
#

--source include/master-slave.inc
--source include/have_binlog_format_mixed.inc

--connection slave

# Step1: Capture the current working replication state.
# We need these to restore a clean environment after we've intentionally
# "broken" the master.info file for the test.
--let $master_port= query_get_value(SHOW SLAVE STATUS, Master_Port, 1)

# Suppress the err we expect to see in the log during this test.
# The server will log these when it hits our new strict validation logic.
call mtr.add_suppression("Error reading master configuration");
call mtr.add_suppression("Failed to initialize the master info structure");
call mtr.add_suppression("error connecting to master");

--let $MYSQLD_DATADIR= `select @@datadir`

--let $rpl_server_number= 2
--source include/rpl_stop_server.inc

# Step2: Simulate a corrupted master.info file.
# The server is now fully stopped, preventing it from flushing its clean
# in-memory state and overwriting our manually hacked file on shutdown.
--move_file $MYSQLD_DATADIR/master.info $MYSQLD_DATADIR/master.info.backup
--write_file $MYSQLD_DATADIR/master.info
17
master-bin.000001
4
127.0.0.1
root

9999 60
60
0
0



0

60.000abcdefghijklm
1 1
EOF

# Step3: Start the server to force it to parse the corrupted file.
--let $rpl_server_number= 2
--source include/rpl_start_server.inc

--connection slave

--echo # Verifying that trailing garbage causes parsing to fail.
--let $port= query_get_value(SHOW SLAVE STATUS, Master_Port, 1)

if ($port == 9999) {
  --echo Error: The garbage in master.info was silently accepted! Port evaluated to $port.
  --die "Test failed: Fix is not preventing garbage parsing."
}

--echo # Rejection successful. The server refused to parse the garbage.

# Step4: Cleanup and Restoration.
# We remove the bad master.info and restore the original from the temp dir.
--remove_file $MYSQLD_DATADIR/master.info
--move_file $MYSQLD_DATADIR/master.info.backup $MYSQLD_DATADIR/master.info

--echo # Restoring the slave to original replication state
--let $rpl_server_number= 2
--source include/rpl_restart_server.inc

--source include/start_slave.inc

--connection master
--source include/rpl_end.inc


--echo # End of master_info_numeric_validation.test

Youez - 2016 - github.com/yon3zu
LinuXploit