X2Go Bug report logs - #1300
X2Go Client: API for setpass between client and broker

version graph

Package: x2goclient; Maintainer for x2goclient is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2goclient is src:x2goclient.

Reported by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Date: Tue, 15 May 2018 17:50:02 UTC

Severity: wishlist

Tags: patch

Found in version 4.1.1.1

Full log


🔗 View this message in rfc822 format

X-Loop: owner@bugs.x2go.org
Subject: Bug#1300: X2Go Client: API for setpass between client and broker
Reply-To: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>, 1300@bugs.x2go.org
Resent-From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: o.schneyder@phoca-gmbh.de, X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Tue, 15 May 2018 17:50:02 +0000
Resent-Message-ID: <handler.1300.B.152640653317337@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 1300
X-X2Go-PR-Package: x2goclient
X-X2Go-PR-Keywords: patch
Received: via spool by submit@bugs.x2go.org id=B.152640653317337
          (code B); Tue, 15 May 2018 17:50:02 +0000
Received: (at submit) by bugs.x2go.org; 15 May 2018 17:48:53 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,URIBL_BLOCKED
	autolearn=ham autolearn_force=no version=3.4.1
Received: from localhost (localhost [127.0.0.1])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 2BA9E5DACE
	for <submit@bugs.x2go.org>; Tue, 15 May 2018 19:48:52 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at ymir.das-netzwerkteam.de
Received: from ymir.das-netzwerkteam.de ([127.0.0.1])
	by localhost (ymir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id l6q5fj3S8LKU for <submit@bugs.x2go.org>;
	Tue, 15 May 2018 19:48:44 +0200 (CEST)
Received: from fregna.das-netzwerkteam.de (fregna.das-netzwerkteam.de [148.251.53.130])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id DA7475DAE9
	for <submit@bugs.x2go.org>; Tue, 15 May 2018 19:48:44 +0200 (CEST)
Received: from grimnir.das-netzwerkteam.de (grimnir.das-netzwerkteam.de [148.251.201.105])
	by fregna.das-netzwerkteam.de (Postfix) with ESMTPS id C1F0F60532
	for <submit@bugs.x2go.org>; Tue, 15 May 2018 17:48:44 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id BC530C47EE
	for <submit@bugs.x2go.org>; Tue, 15 May 2018 19:48:44 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at grimnir.das-netzwerkteam.de
Received: from grimnir.das-netzwerkteam.de ([127.0.0.1])
	by localhost (grimnir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id O-0ZbqA2wI4K for <submit@bugs.x2go.org>;
	Tue, 15 May 2018 19:48:39 +0200 (CEST)
Received: from das-netzwerkteam.de (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTPS id 5C873C47EC
	for <submit@bugs.x2go.org>; Tue, 15 May 2018 19:48:39 +0200 (CEST)
Received: from x590fef8b.dyn.telefonica.de (x590fef8b.dyn.telefonica.de
 [89.15.239.139]) by mail.das-netzwerkteam.de (Horde Framework) with HTTPS;
 Tue, 15 May 2018 17:48:39 +0000
Date: Tue, 15 May 2018 17:48:39 +0000
Message-ID: <20180515174839.Horde.kG-AiQlB1gHr6wpnWJ-sgM_@mail.das-netzwerkteam.de>
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: submit@bugs.x2go.org
User-Agent: Horde Application Framework 5
Accept-Language: de,en
Organization: DAS-NETZWERKTEAM
X-Originating-IP: 89.15.239.139
X-Remote-Browser: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Firefox/52.0
Content-Type: multipart/signed; boundary="=_NfezJSE4ZHgRb6hFTp0SfCc";
 protocol="application/pgp-signature"; micalg=pgp-sha256
MIME-Version: 1.0
[Message part 1 (text/plain, inline)]
Package: x2goclient
Severity: wishlist
Version: 4.1.1.1
Tags: patch
X-Debbugs-Cc: o.schneyder@phoca-gmbh.de


Hi Alex,

a customer of mine is paying me to do some work on X2Go Client and  
X2Go Broker.

While doing that, I noticed that the --change-broker-pass option in  
X2Go Client does not fully work together with the X2Go Session Broker.  
In fact, I could not find any implementation reference in earlier  
broker prototypes.

I thus came up with some "API" for password setting.

When the client sends the setpass task to the broker, it expects an  
answer (success or failure). I will scan for PASSWORD CHANGED: OK (or  
something else).

Please take a look at the below patch, if it breaks something for your setups.

If you have a different "API" for setpass, please let me know and I  
adapt the patch.

Greets,
Mike


```
diff --git a/src/httpbrokerclient.cpp b/src/httpbrokerclient.cpp
index 1416348..19c6068 100644
--- a/src/httpbrokerclient.cpp
+++ b/src/httpbrokerclient.cpp
@@ -493,7 +493,7 @@ void HttpBrokerClient::slotPassChanged(bool  
success, QString answer, int)
      }
      if(!checkAccess(answer))
          return;
-
+    parsePwdChangedResult(answer);
  }

  void HttpBrokerClient::slotSelectSession(bool success, QString answer, int)
@@ -546,6 +546,19 @@ void HttpBrokerClient::slotRequestFinished (  
QNetworkReply*  reply )
      reply->deleteLater();
  }

+void HttpBrokerClient::parsePwdChangedResult(QString pwdchres)
+{
+    x2goDebug<<"Starting parser.";
+    QStringList lst=pwdchres.split("PASSWORD CHANGED:  
",QString::SkipEmptyParts);
+    QString result = (lst[1].split("\n"))[0];
+    x2goDebug<<"Password change result is: "<<result;
+    x2goDebug<<"Parsing has finished.";
+    if (result == "OK" )
+        emit passwordChanged(config->brokerPass);
+    else
+        emit passwordChanged(QString::null);
+}
+
  void HttpBrokerClient::parseSession(QString sinfo)
  {
      config->sessiondata="";
diff --git a/src/httpbrokerclient.h b/src/httpbrokerclient.h
index 3cb0eb0..bb578f6 100644
--- a/src/httpbrokerclient.h
+++ b/src/httpbrokerclient.h
@@ -63,6 +63,7 @@ private:
  private:
      void createIniFile(const QString& raw_content);
      void parseSession(QString sInfo);
+    void parsePwdChangedResult(QString pwdchres);
      void createSshConnection();
      bool checkAccess(QString answer);

```

-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
mobile: +49 (1520) 1976 148
landline: +49 (4354) 8390 139

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

[Message part 2 (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Sun Feb 5 07:01:56 2023; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.