[X2Go-Commits] [x2goclient] 01/01: src/sshmasterconnection: ignore "garbage", but require at least one line to start with a known challenge auth prompt. Fixes: #966.

git-admin at x2go.org git-admin at x2go.org
Fri Sep 1 08:32:47 CEST 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goclient.

commit ad6268711062cbabbe0ec67d67d1f0df38b43217
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Sep 1 08:32:14 2017 +0200

    src/sshmasterconnection: ignore "garbage", but require at least one line to start with a known challenge auth prompt. Fixes: #966.
---
 debian/changelog            |  2 ++
 src/sshmasterconnection.cpp | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 0b11622..9ed36f0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -182,6 +182,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium
       effect on this behavior, so removing it again.
     - Makefile: add comment explaining why we need to do this in the first
       place and why it's so complicated.
+    - src/sshmasterconnection: ignore "garbage", but require at least one line
+      to start with a known challenge auth prompt. Fixes: #966.
   * x2goclient.spec:
     - Respect %{optflags} and pass QMAKE_STRIP=: to fix missing debug info
       issues.
diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp
index 0556299..e0ea7d2 100644
--- a/src/sshmasterconnection.cpp
+++ b/src/sshmasterconnection.cpp
@@ -1196,9 +1196,20 @@ bool SshMasterConnection::userChallengeAuth()
             else {
               for (std::size_t i = 0; i < challenge_auth_code_prompts_size; ++i) {
                 x2goDebug << "Checking against known prompt #" << i << ": " << challenge_auth_code_prompts_[i] << endl;
-                if (pr.startsWith (challenge_auth_code_prompts_[i])) {
+
+                /* Ignore "garbage" at the start of the string, but require at least one line to start with a known prompt. */
+                QStringList tmp_str_list = pr.split ("\n", QString::SkipEmptyParts);
+
+                for (QStringList::const_iterator cit = tmp_str_list.constBegin (); cit != tmp_str_list.constEnd (); ++cit) {
+                  if ((*cit).startsWith (challenge_auth_code_prompts_[i])) {
                     has_challenge_auth_code_prompt = true;
                     break;
+                  }
+                }
+
+                /* Skip over other challenge auth code prompts if we found one already. */
+                if (has_challenge_auth_code_prompt) {
+                  break;
                 }
               }
             }

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list