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

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to x2go-dev@lists.x2go.org, o.schneyder@phoca-gmbh.de, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1300; Package x2goclient. (Tue, 15 May 2018 17:50:02 GMT) (full text, mbox, link).


Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
New Bug report received and forwarded. Copy sent to o.schneyder@phoca-gmbh.de, X2Go Developers <x2go-dev@lists.x2go.org>. (Tue, 15 May 2018 17:50:02 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: submit@bugs.x2go.org
Subject: X2Go Client: API for setpass between client and broker
Date: Tue, 15 May 2018 17:48:39 +0000
[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: Sat Nov 23 10:07:21 2024; 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.