bug #1662976 Authentication fails when controluser/pass is set

This commit is contained in:
Sebastian Mendel
2007-03-19 15:06:53 +00:00
parent d0f31e2091
commit 420a9d58e7
5 changed files with 28 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ $HeadURL$
- bug #1664212 querywindow loses url encoded characters
- bug #1682044 Export file even if file not selected
- bug #1672789 Undefined offset: 4 in sqlparser.lib.php #1674
- bug #1662976 Authentication fails when controluser/pass is set
- [gui] avoid displaying a wide selector in server selection
+ [core] added PMA_fatalError() and made use of it
. [i18n] use generic $strOptions

View File

@@ -3378,10 +3378,12 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// get the privileges list for the current user but the true user link
// must be open after this one so it would be default one for all the
// scripts)
$controllink = false;
if ($cfg['Server']['controluser'] != '') {
$controllink = PMA_DBI_connect($cfg['Server']['controluser'],
$cfg['Server']['controlpass'], true);
} else {
}
if (! $controllink) {
$controllink = PMA_DBI_connect($cfg['Server']['user'],
$cfg['Server']['password'], true);
} // end if ... else

View File

@@ -78,7 +78,13 @@ function PMA_DBI_connect($user, $password, $is_controluser = FALSE) {
$link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? NULL : $client_flags);
}
if (empty($link)) {
debug_print_backtrace();
die;
if (empty($link) && ! $is_controluser) {
if ($is_controluser) {
define('PMA_DBI_CONNECT_FAILED_CONTROLUSER', true);
return false;
}
PMA_auth_fails();
} // end if

View File

@@ -107,6 +107,10 @@ function PMA_DBI_connect($user, $password, $is_controluser = false)
}
if ($return_value == false) {
if ($is_controluser) {
define('PMA_DBI_CONNECT_FAILED_CONTROLUSER', true);
return false;
}
PMA_auth_fails();
} // end if

View File

@@ -345,8 +345,8 @@ if (! empty($GLOBALS['PMA_errors']) && is_array($GLOBALS['PMA_errors'])) {
* modified: 2004-05-05 mkkeck
*/
if ($server != 0
&& $cfg['Server']['user'] == 'root'
&& $cfg['Server']['password'] == '') {
&& $cfg['Server']['user'] == 'root'
&& $cfg['Server']['password'] == '') {
echo '<div class="warning">' . $strInsecureMySQL . '</div>' . "\n";
}
@@ -391,6 +391,9 @@ if (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION < 32332) {
echo '<div class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.32') . '</div>' . "\n";
}
/**
* Warning about different MySQL library and server version
*/
if ($server > 0 && PMA_MYSQL_CLIENT_API !== PMA_MYSQL_INT_VERSION) {
echo '<div class="warning">'
. PMA_sanitize(sprintf($strMysqlLibDiffersServerVersion,
@@ -399,6 +402,14 @@ if ($server > 0 && PMA_MYSQL_CLIENT_API !== PMA_MYSQL_INT_VERSION) {
. '</div>' . "\n";
}
/**
* Warning about wrong controluser settings
*/
$strControluserFailed = 'Connection for controluser as defined in your config.inc.php failed.';
if (defined('PMA_DBI_CONNECT_FAILED_CONTROLUSER')) {
echo '<div class="warning">' . $strControluserFailed . '</div>' . "\n";
}
if (defined('PMA_WARN_FOR_MCRYPT')) {
echo '<div class="warning">' . PMA_sanitize(sprintf($strCantLoad, 'mcrypt')) . '</div>' . "\n";
}