X2Go Bug report logs - #1133
Inconsistent Perl used by server or its agent on connect

version graph

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

Reported by: Ted Toal <twtoal@ucdavis.edu>

Date: Tue, 10 Jan 2017 21:20:02 UTC

Severity: normal

Tags: not-a-bug

Found in version 4.0.1.20

Done: Stefan Baur <X2Go-ML-1@baur-itcs.de>

Bug is archived. No further changes may be made.

Full log


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

Received: (at 1133) by bugs.x2go.org; 11 Jan 2017 09:11:29 +0000
From X2Go-ML-1@baur-itcs.de  Wed Jan 11 10:11:28 2017
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham
	version=3.3.2
Received: from localhost (localhost [127.0.0.1])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id EC0DA3CDDD
	for <1133@bugs.x2go.org>; Wed, 11 Jan 2017 10:11:27 +0100 (CET)
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 VmoGGXP3CI4b for <1133@bugs.x2go.org>;
	Wed, 11 Jan 2017 10:11:21 +0100 (CET)
Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 3F6CF5DA91
	for <1133@bugs.x2go.org>; Wed, 11 Jan 2017 10:11:21 +0100 (CET)
Received: from [192.168.0.23] ([78.43.90.159]) by mrelayeu.kundenserver.de
 (mreue102 [212.227.15.145]) with ESMTPSA (Nemesis) id
 0M9oRE-1cKc4j1g6K-00B3UR; Wed, 11 Jan 2017 10:05:57 +0100
Subject: Re: [X2Go-Dev] Bug#1133: Bug#1133: Inconsistent Perl used by server
 or its agent on connect
To: Ted Toal <twtoal@ucdavis.edu>, 1133@bugs.x2go.org
References: <BF57B030-7BF4-4307-9333-49782AB84D74@ucdavis.edu>
 <7a1f025f-6a4f-9c6a-ffe6-4d18a712da86@baur-itcs.de>
 <E4861E92-0216-40D2-91E6-A6A693F5E30B@ucdavis.edu>
 <836dd91e-6bc3-35e1-3759-e66b55715b1b@baur-itcs.de>
 <35BC44E5-C0D7-4B77-A09E-FBD00AD5193E@ucdavis.edu>
From: Stefan Baur <X2Go-ML-1@baur-itcs.de>
Message-ID: <7b997594-addb-eced-9c41-1d520f712fa8@baur-itcs.de>
Date: Wed, 11 Jan 2017 10:05:46 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <35BC44E5-C0D7-4B77-A09E-FBD00AD5193E@ucdavis.edu>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="OxSNwdqkmBxxUlkTONW4b0xC3fXQwCXfk"
X-Provags-ID: V03:K0:kyTHo9hnbi6yW7I7nCwsfJ0DjbFpxcZfY344tVvmgkfEh0hwGhB
 PRSq5xmGLr7+4/vr+Uuoi5+6WAOHYBeL6UR2DbMOtByMlh4p5IyAWWGC3igiPfd71qmdwRs
 /7kO+JDbQCocHZcTGHLkmkQDdidPZcHMxuBWWk2n7soNEOQQTIq7vVxI0dJWDmVnl715eY5
 181Ao0XBYW7EzPGoxofgQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:Pv5hjUiTkGw=:AYgs/MZvnTnqrb3OBeiRNi
 /0giegeNgolbhw6LfGY4l0PjpoXW0hjZOTvsvGmTIEoYw51iJS7ZlDowdG0yr6uKe6WvaBI9Z
 8roPoTbN4ncehRpz4yw6QO5rj3F1q++T0Mt0hhw9d/rRdMxnkwkGg23/s+g4qBtCHBEMac38W
 KnNdlGfV+qQxQtFIYaeDlrrZQkxiGP/PIhY1qmp3g3Bpl7I8DZYNNqJTGRTx6xhbqeMHXGjj+
 0gsX4Ho/chQaM2TuxoM1f25cPhYVvALEVtiRT4O5wPgYITSRUMk/ajWkBXJF4rMKJFACxAwye
 nYLH9t2xnWZ56bxbEuxhSXwtKGwfwtLt1bsqmD6XXt8G/A6AUmnHyb5CJ/0r6C401jkOFAJvs
 mZYDsMIUeZ9fILv+u3oic/Syi2W3KZxCMKqq06xojZaUUTDzlI5EouwmLhfCyzLYNlh6k/k1v
 wFRTjSSvTUjrHuHZt4f79mZjXXpz61GDmxo0FD1aWNt0d0iHAxJU06is44jyQ+6J3QlIv2ln/
 iB4v5eDgqSA8EL39JodWXE179Gg/soej3UXPOha/bf/drO0eUoUWIiMeaNc8bFipLji9aCHDs
 4fTDPe2c/OSiqQWn4fJ+SsyPAXjsRj8kz7Ks42ihTdc9x9mYMPH90z2IKETPZxtuGXyDrMV2+
 evDFtINbFAF2AMIwY0ydyAMKe6I7msykCI1ZrcYb1znUjwPFTkK6ealzUTmKBVP1pRCA=
[Message part 1 (text/plain, inline)]
Control: close -1
thanks

[re-sent as the original message went to Ted's personal mailbox only]

Am 11.01.2017 um 02:48 schrieb Ted Toal:
> > perl has the -l option for specifying the PERL5LIB path.  That
option can, and I think should, be used on the shebang of the x2go perl
scripts:
> >
> > #!/usr/bin/perl -l /usr/lib/perl5
> >
> > or something like that.  I know the shebang line allows args.

Ted,

while we agree that options *can* be used on the shebang line, I
disagree that they should be used in our scripts for specifying
something that *is the default*.
You would, indeed, change the shebang to "#!/usr/bin/perl -T" if you
wanted to run the script in taint mode, which is a non-default setting.

Also, the parameter to set the library path is not -l (lower-case L),
but -I (upper-case i).  I would suggest using a font that displays them
differently, it makes coding a lot easier.

Why explicitly setting the PERL5LIB path in the shebang line is a bad
idea can be shown like this:

First, run
perl -e 'print "@INC\n";'
to display the default.

On my system, this returns:
/etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2
/usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20
/usr/share/perl/5.20 /usr/local/lib/site_perl .

Next, run
perl -I /foo -e 'print "@INC\n";'
which corresponds to setting -I /foo on the shebang line.

On my system, this returns:
/foo /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2
/usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20
/usr/share/perl/5.20 /usr/local/lib/site_perl .

Notice how the search path is extended, not replaced, by /foo ending up
at the beginning.

Now let's see what happens when combining -I *and* a set PERL5LIB variable:
PERL5LIB=/bar perl -I /foo -e 'print "@INC\n";'

This results in:
/foo /bar /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2
/usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20
/usr/share/perl/5.20 /usr/local/lib/site_perl .

You can see that /foo and /bar are added to the search path, with the
value of -I taking precedence, as in being listed and thus searched
first, over PERL5LIB.

And this is exactly NOT what a user expects, even though it would solve
your percieved problem:

Standard Unix practice is that when an environment variable is set, it
should take precedence over any default, and a command line option set
should take precedence over any environment variable.

Adding -I /path/to/libs at the shebang line would break what is expected
behavior.

No one keeps you from running a search and replace on all X2Go-related
scripts after installing them, though ...

However, I would strongly recommend against that and suggest un-setting
PERL5LIB in .bashrc when an X2Go-related bash invocation is detected,
instead.

Why this doesn't work for you the way it does for us is what we're
tracking in Bug #1134, so again, closing this bug.

Kind Regards,
Stefan Baur
-- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243


[signature.asc (application/pgp-signature, attachment)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu Mar 28 08:52:30 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.