Fix up the detection of the localhost address when there is both IPv4 and IPv6 information available for the connection.

This commit is contained in:
Ken Moore
2016-02-09 09:18:21 -05:00
parent 98409969c5
commit e1b9bc833c
2 changed files with 6 additions and 13 deletions

View File

@@ -78,7 +78,7 @@ int AuthorizationManager::checkAuthTimeoutSecs(QString token){
// == Token Generation functions
QString AuthorizationManager::LoginUP(QHostAddress host, QString user, QString pass){
//Login w/ username & password
bool localhost = ( (host== QHostAddress::LocalHost) || (host== QHostAddress::LocalHostIPv6) );
bool localhost = ( (host== QHostAddress::LocalHost) || (host== QHostAddress::LocalHostIPv6) || (host.toString()=="::ffff:127.0.0.1") );
bool ok = false;
//First check that the user is valid on the system and part of the operator group
bool isOperator = false;
@@ -89,7 +89,7 @@ QString AuthorizationManager::LoginUP(QHostAddress host, QString user, QString p
return ""; //user not allowed access if not in either of the wheel/operator groups
}
}else{ isOperator = true; }
//qDebug() << "Check username/password" << user << pass;
qDebug() << "Check username/password" << user << pass << localhost;
//Need to run the full username/password through PAM
if(!localhost || user=="root" || user=="toor"){
ok = pam_checkPW(user,pass);