GNU bug report logs - #29035
.bashrc updates

Previous Next

Package: guix-patches;

Reported by: Marius Bakke <mbakke <at> fastmail.com>

Date: Fri, 27 Oct 2017 23:51:02 UTC

Severity: normal

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 29035 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 29035 <at> debbugs.gnu.org
Subject: Re: [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead
 of $SSH_CLIENT in .bashrc.
Date: Sun, 29 Oct 2017 22:26:16 +0100
Heya!

Marius Bakke <mbakke <at> fastmail.com> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:

[...]

>> I think it would make sense to add a test to (gnu tests ssh) for this,
>> because it’s 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’t quite work (due to lack of tilde
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:
>
> <https://github.com/openssh/openssh-portable/blob/b7548b12a6b2b4abf4d057192c353147e0abba08/session.c#L998>
> (_PATH_STDPATH is the --with-default-path)

That’s maybe more than we’d like to do, and also doesn’t 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 <mbakke <at> fastmail.com>
> 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 test in
> a conditional testing for interactive shell.

LGTM.

Thank you!

Ludo’.




This bug report was last modified 7 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.