Subject: Make x2goterminate-session / x2gosuspend-session operable as root

From: Mike Gabriel <[email-masked]>
Date: Mon, 23 Sep 2013 12:23:55 +0200

Package: x2goserver
Severity: wishlist

Currently, only the user owning a session can suspend/terminate that session.

The super-user root should also be eligible to act on user sessions  
with those commands.

This should work from any x2goserver (in a multi-node farm) and with  
SQLite and PostgreSQL db backend.

Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Stefan Baur <[email-masked]>
Date: Mon, 23 Sep 2013 12:51:07 +0200

> SQLite and PostgreSQL db backend.

We're only using single node mode, but here, terminating sessions from 
root works (or at least, it did last time we needed it).
x2golistsessions_root | awk -F '|' '{ print $2 " " $12 "@" $8 }' # lists 
session-IDs followed by username@clientname
x2goterminate-session $SESSIONID # this terminates the session with the 
named ID when called by root

Never tried suspend, but there's x2gosuspend-session which should work 
the same way.

So, either you missed that or your bug report should contain a few more 
details as to what functionality you need and what is missing, I'd say. ;-)

-Stefan

---

From: Mike Gabriel <[email-masked]>
Date: Mon, 23 Sep 2013 23:27:33 +0200

Hi Stefan,

On Mo 23 Sep 2013 12:51:07 CEST Stefan Baur wrote:

>> This should work from any x2goserver (in a multi-node farm) and  
>> with SQLite and PostgreSQL db backend.
>
> We're only using single node mode, but here, terminating sessions  
> from root works (or at least, it did last time we needed it).
> x2golistsessions_root | awk -F '|' '{ print $2 " " $12 "@" $8 }' #  
> lists session-IDs followed by username@clientname
> x2goterminate-session $SESSIONID # this terminates the session with  
> the named ID when called by root

With the SQLite backend this surely is the case.

> Never tried suspend, but there's x2gosuspend-session which should  
> work the same way.
>
> So, either you missed that or your bug report should contain a few  
> more details as to what functionality you need and what is missing,  
> I'd say. ;-)

With PostgreSQL, you get this:

"""
x2goterminate-session mga-54-1379970522_stRTERMINAL_dp24
DBD::Pg::st execute failed: ERROR:  permission denied for relation  
sessions_view at /usr/share/perl5/X2Go/Server/DB/PostgreSQL.pm line 417.
Died at /usr/share/perl5/X2Go/Server/DB/PostgreSQL.pm line 417.
DBD::Pg::st execute failed: ERROR:  permission denied for relation  
sessions_view at /usr/share/perl5/X2Go/Server/DB/PostgreSQL.pm line 328.
Died at /usr/share/perl5/X2Go/Server/DB/PostgreSQL.pm line 328.
"""

Nowadays, the x2gocleansessions daemon script can handle  
suspend/terminate through a change in the session database.

x2goterminate-session and x2gosuspend-session should utilize this new feature.

Mike

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy:

---

From: Stefan Baur <[email-masked]>
Date: Mon, 23 Sep 2013 23:31:21 +0200

Am 23.09.2013 23:27, schrieb Mike Gabriel:
> [x2goterminate-session working as expected]

That sounds like it makes sense. ;-) And now the bug/wishlist 
description is detailed enough that we'll all still remember what this 
was about, 6 months down the road. ;-)

-Stefan

---

From: Moritz Struebe <[email-masked]>
Date: Tue, 24 Sep 2013 09:47:15 +0200

On 2013-09-23 12:23, Mike Gabriel wrote:
> The super-user root should also be eligible to act on user sessions with those commands.
>

Hmm, but the super user can su to the user owning the session, right?

Morty

- -- 
Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter)
Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme)
Friedrich-Alexander-Universität Erlangen-Nürnberg
Martensstr. 1
91058 Erlangen

Tel   : +49 9131 85-25419
Fax   : +49 9131 85-28732
eMail : [email-masked]
WWW   : http://www4.informatik.uni-erlangen.de/~morty

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 24 Sep 2013 10:19:10 +0200

Hi Morty,

On Di 24 Sep 2013 09:47:15 CEST Moritz Struebe wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>

Basically correct, but this does not help on larger setups where the  
homes are on AFS or NFSv4+Krb5.

Mike

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy: