[X2Go-Commits] x2goclient.git - build-main (branch) updated: 4.0.1.1-67-g6f9ead7
X2Go dev team
git-admin at x2go.org
Tue Dec 17 15:43:35 CET 2013
The branch, build-main has been updated
via 6f9ead7cf9184799f0b6ae9ff1efd0c7b879d0c6 (commit)
from 3aa82279301216509425bdd10bd8ef41c3f795cb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 1 +
sshmasterconnection.cpp | 26 +++++++++++++++++++++-----
2 files changed, 22 insertions(+), 5 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 2d010f7..9ddf90f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -62,6 +62,7 @@ x2goclient (4.0.1.2-0x2go2) UNRELEASED; urgency=low
on Linux and Mac and plink/pscp on Windows.
- Support for ChallengeResponseAuthentication (Google Authenticator)
- Setting main window focus on mac (Fixes: #139).
+ - Additional check if authentication with GSSApi successfull
[ Heinrich Schuchardt ]
* New upstream version (4.0.1.2):
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp
index d705f7c..37673ea 100644
--- a/sshmasterconnection.cpp
+++ b/sshmasterconnection.cpp
@@ -32,6 +32,8 @@
#endif
#include <math.h>
+#include <QUuid>
+
#ifndef Q_OS_WIN
#include <sys/socket.h> /* for socket(), connect(), send(), and recv() */
#include <arpa/inet.h> /* for sockaddr_in and inet_addr() */
@@ -1106,12 +1108,17 @@ bool SshMasterConnection::userAuthKrb()
QProcess ssh;
QString sshCmd;
+ QUuid uuid = QUuid::createUuid();
+ QString uuidStr = uuid.toString().mid(1, 36).toLower();
+
+ QString shcmd = " echo X2GODATABEGIN:" + uuidStr + "; whoami; echo X2GODATAEND:" + uuidStr ;
+
#ifdef Q_OS_WIN
sshCmd="plink -batch "+user+"@"+host+" -P "+
- QString::number(port)+ " whoami";
+ QString::number(port)+ shcmd;
#else
sshCmd="ssh -o GSSApiAuthentication=yes "+user+"@"+host+" -p "+
- QString::number(port)+ " -o PasswordAuthentication=no whoami";
+ QString::number(port)+ " -o PasswordAuthentication=no "+shcmd;
#endif
#ifdef DEBUG
@@ -1132,10 +1139,12 @@ bool SshMasterConnection::userAuthKrb()
if (!ssh.waitForFinished(20000))
{
sshProcErrString=ssh.errorString();
+ authErrors<<tr("Failed to start SSH Client. Please check your installation and GSSApi configuration");
authErrors<<sshProcErrString;
#ifdef DEBUG
x2goDebug<<"ssh not finished:" <<sshProcErrString<<endl;
#endif
+
return false;
}
QString outp=ssh.readAllStandardOutput();
@@ -1146,10 +1155,17 @@ bool SshMasterConnection::userAuthKrb()
x2goDebug<<"stderr - "<<err<<endl;
x2goDebug<<"code - "<<ssh.exitCode()<<", status - "<<ssh.exitStatus()<<endl;
#endif
- if (ssh.exitCode() == 0 && ssh.exitStatus() == 0)
+
+ QString begin_marker = "X2GODATABEGIN:"+uuidStr+"\n";
+ QString end_marker = "X2GODATAEND:"+uuidStr+"\n";
+ int output_begin=outp.indexOf(begin_marker) + begin_marker.length();
+ int output_end=outp.indexOf(end_marker);
+ outp = outp.mid(output_begin, output_end-output_begin);
+ outp.replace("\n","");
+
+ if (ssh.exitCode() == 0 && ssh.exitStatus() == 0 && outp== user)
return true;
- sshProcErrString=err;
- authErrors<<sshProcErrString;
+ authErrors<<tr("Check your GSSApi configuration or choose another authentication method");
return false;
}
hooks/post-receive
--
x2goclient.git (X2Go Client)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goclient.git" (X2Go Client).
More information about the x2go-commits
mailing list