From X2Go-ML-1@baur-itcs.de Wed Jan 11 10:11:28 2017 Received: (at 1133) by bugs.x2go.org; 11 Jan 2017 09:11:29 +0000 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 , 1133@bugs.x2go.org References: <7a1f025f-6a4f-9c6a-ffe6-4d18a712da86@baur-itcs.de> <836dd91e-6bc3-35e1-3759-e66b55715b1b@baur-itcs.de> <35BC44E5-C0D7-4B77-A09E-FBD00AD5193E@ucdavis.edu> From: Stefan Baur 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= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OxSNwdqkmBxxUlkTONW4b0xC3fXQwCXfk Content-Type: multipart/mixed; boundary="e2BbrNxwDtwPcIt0HpS4JEh8eAo7g2Ju3"; protected-headers="v1" From: Stefan Baur To: Ted Toal , 1133@bugs.x2go.org Message-ID: <7b997594-addb-eced-9c41-1d520f712fa8@baur-itcs.de> Subject: Re: [X2Go-Dev] Bug#1133: Bug#1133: Inconsistent Perl used by server or its agent on connect References: <7a1f025f-6a4f-9c6a-ffe6-4d18a712da86@baur-itcs.de> <836dd91e-6bc3-35e1-3759-e66b55715b1b@baur-itcs.de> <35BC44E5-C0D7-4B77-A09E-FBD00AD5193E@ucdavis.edu> In-Reply-To: <35BC44E5-C0D7-4B77-A09E-FBD00AD5193E@ucdavis.edu> --e2BbrNxwDtwPcIt0HpS4JEh8eAo7g2Ju3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 variabl= e: PERL5LIB=3D/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 --=20 BAUR-ITCS UG (haftungsbeschr=C3=A4nkt) Gesch=C3=A4ftsf=C3=BChrer: Stefan Baur Eichen=C3=A4ckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364 Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243 --e2BbrNxwDtwPcIt0HpS4JEh8eAo7g2Ju3-- --OxSNwdqkmBxxUlkTONW4b0xC3fXQwCXfk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJYdfVtAAoJEG7d9BjNvlEZDf8H/RUhtl2p8Wg2Ju0Gi8E9nup3 brb9Od30SOOzmXuWbYCzMJfYKWOwjSP0580jvK3HvlmwbFbEDeEMWHikboU6fFbs znYNtiXTlyvAKIpaoO6dpH5sExZ0Ytt1CF9+rUmKo7YTFhYt6wUahP2eiSItzYNy H0Y5kxjjW4vhsIViABMk127TMbHDY12pIhKrIqZmR9LmxObvTttaBeN6PnmwCesi n1uOZSr1QCybJfPIELOSzs3v4GYXFXNkmpVaRsHJRJP+QoQ2wqQZO9hsVp+0thIu dVg2cXIwWcAXQxctKJf+91kNFqePbei7Rkn+lNHmRr45TIMB2bptKrHF3mzSvuQ= =p1c+ -----END PGP SIGNATURE----- --OxSNwdqkmBxxUlkTONW4b0xC3fXQwCXfk--