[X2Go-Dev] [X2Go-Commits] [x2goserver] 01/01: x2gostartagent, x2golistsession, x2gosuspend-session and x2goresume-session getting agent state from ~/.x2go/C-$SID/state. This should help to avoid session damage. (Fixes: #302).
Mike Gabriel
mike.gabriel at das-netzwerkteam.de
Fri Jun 27 00:20:58 CEST 2014
Hi Alex,
> commit cee48577633c72988dd8563ceae7bf04cfe7d518
> Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
> Date: Wed Jun 25 16:43:16 2014 +0200
>
> x2gostartagent, x2golistsession, x2gosuspend-session and
> x2goresume-session getting agent state from ~/.x2go/C-$SID/state.
> This should help to avoid session damage. (Fixes: #302).
> ---
> X2Go/Server/Agent.pm | 6 +-
> X2Go/Server/Agent/NX.pm | 76
> +++++++-------------
> debian/changelog | 5 ++
> debian/control | 1 +
> x2goserver/bin/x2golistsessions | 10 ++-
> x2goserver/bin/x2goresume-session | 55 ++++++++++++++
> x2goserver/bin/x2gostartagent | 6 +-
> x2goserver/bin/x2gosuspend-session | 37 +++++-----
> .../Agent.pm => x2goserver/lib/x2gogetagentstate | 46 +++---------
> 9 files changed, 135 insertions(+), 107 deletions(-)
some more feedback on this commit...
On Mi 25 Jun 2014 16:43:33 CEST, git-admin wrote:
> +sub get_agent_state
> +{
> + my $sess=@_[1];
> + my $user=@_[2];
> + my $state;
> + my $stateFile = File::HomeDir->users_home($user) .
> "/.x2go/C-".$sess."/state";
WARNING: reading as root in $HOME of other users completely breaks
X2Go installations with homes on NFS with root-squash option enabled
(normally the default). It also breaks X2Go on machines with NFSv4
encrypted homes or AFS homes.
Please note that I moved the session log file (which we scanned before
this commit for the session status) to
/tmp/.x2go-$user/session-C-<sessionid>.log with some earlier commits
to fix NFS homes breakage.
Actually, the state file should also go to
/tmp/.x2go-$user/session-C-<sessionid>.state.
Please fix that, so X2Go Server continues running smoothly for users
with NFS homes.
Additionally, this would allow us to move the session.log file back to
$HOME/.x2go/C-<sessionid>/session.log and drop the symlink to /tmp...
at that location.
> + if (! -e $stateFile )
> + {
> + die "state file not exists: $stateFile\n";
> + }
> + else
> + {
> + open(F,"<$stateFile");
> + $state=<F>;
> + close(F);
> + }
> + return $state;
> +}
> diff --git a/debian/control b/debian/control
> index 373738e..5976f26 100644
> --- a/debian/control
> +++ b/debian/control
> @@ -21,6 +21,7 @@ Depends:
> ${misc:Depends},
> libfile-basedir-perl,
> libfile-readbackwards-perl,
> + libfile-homedir-perl,
> libtry-tiny-perl,
> libx2go-server-perl (>= ${source:Version}), libx2go-server-perl
> (<< ${source:Version}.1~),
> x2goagent (>= 2:3.5.0.25-0~),
Fixing the above part for the location of the state file will also
allow us to drop this extra dependency again. Please remove that, if
your solution for the above problem drops File::HomeDir.
Greets,
Mike
--
DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31
mail: mike.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digitale PGP-Signatur
URL: <http://lists.x2go.org/pipermail/x2go-dev/attachments/20140626/0cb0c01f/attachment.pgp>
More information about the x2go-dev
mailing list