Fix remote DB host in installer_base.lib.php
Hi,
I think having find a bug to complete an new ispconfig when the Database in on remote host (like docker, ...).
In the installer_base.lib.php, line 249 => 255, we can find this :
if($conf['mysql']['admin_password'] == '') {
caselog("mysql --default-character-set=".escapeshellarg($conf['mysql']['charset'])." -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." ".escapeshellarg($conf['mysql']['database'])." < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
} else {
caselog("mysql --default-character-set=".escapeshellarg($conf['mysql']['charset'])." -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." ".escapeshellarg($conf['mysql']['database'])." < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
}
If i clean a little this code to extract the command, we will find this :
mysql --default-character-set=charset -h host -u user -p pass db < sqlfile &> /dev/null"...
But in this command you forget one essential parameters in some secure system : the hosting port ! It must be fix with a command like this :
mysql --default-character-set=charset -h host -P post -u user -p pass db < sqlfile &> /dev/null"...