From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8v6n-0003sf-CP for guix-patches@gnu.org; Sun, 29 Oct 2017 17:27:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8v6k-0005sH-2n for guix-patches@gnu.org; Sun, 29 Oct 2017 17:27:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e8v6j-0005s3-Us for guix-patches@gnu.org; Sun, 29 Oct 2017 17:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e8v6j-00078O-KE for guix-patches@gnu.org; Sun, 29 Oct 2017 17:27:01 -0400 Subject: [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87mv4cxi9n.fsf@fastmail.com> <20171027235357.28600-1-mbakke@fastmail.com> <87lgjv7lhu.fsf@gnu.org> <8760ay5kd5.fsf@fastmail.com> <877eve3uc3.fsf@gnu.org> <87y3nt4t0z.fsf@fastmail.com> Date: Sun, 29 Oct 2017 22:26:16 +0100 In-Reply-To: <87y3nt4t0z.fsf@fastmail.com> (Marius Bakke's message of "Sun, 29 Oct 2017 21:07:40 +0100") Message-ID: <87r2tl1w93.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Marius Bakke Cc: 29035@debbugs.gnu.org Heya! Marius Bakke skribis: > Ludovic Court=C3=A8s writes: [...] >> I think it would make sense to add a test to (gnu tests ssh) for this, >> because it=E2=80=99s one of these things that annoy everyone. > > Good idea. I came up with this: Perfect! > It works as expected with both approaches (changing .bashrc, and > changing "--with-default-path"). WDYT? Given that --with-default-path doesn=E2=80=99t quite work (due to lack of t= ilde expansion), I suppose we should go for .bashrc? > So while it works with "bash" as the login shell, unexpected results may > occur with others. It doesn't seem impossible to patch OpenSSH to > perform this expansion, though: > > > (_PATH_STDPATH is the --with-default-path) That=E2=80=99s maybe more than we=E2=80=99d like to do, and also doesn=E2= =80=99t help with the two other SSH implementations. >> Should we do something similar for lsh and Dropbear? > > Probably. Since we have a system test, it's easy to experiment with. > For now I think this .bashrc workaround might be the easiest approach, > which makes the above test pass for both OpenSSH and Dropbear: > > From 6f4dfbea9cd92a3b03d7e1db89c75a88f4495ba5 Mon Sep 17 00:00:00 2001 > From: Marius Bakke > Date: Sun, 29 Oct 2017 21:02:19 +0100 > Subject: [PATCH] system: Test for interactive shell instead of `cat` in > skeleton '.bashrc'. > > * gnu/system/shadow.scm (default-skeletons)[bashrc]: Wrap $SSH_CLIENT tes= t in > a conditional testing for interactive shell. LGTM. Thank you! Ludo=E2=80=99.