From: ludo@gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke@fastmail.com>
Cc: 29035@debbugs.gnu.org
Subject: [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 [thread overview]
Message-ID: <87r2tl1w93.fsf@gnu.org> (raw)
In-Reply-To: <87y3nt4t0z.fsf@fastmail.com> (Marius Bakke's message of "Sun, 29 Oct 2017 21:07:40 +0100")
Heya!
Marius Bakke <mbakke@fastmail.com> skribis:
> Ludovic Courtès <ludo@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@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’.
next prev parent reply other threads:[~2017-10-29 21:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 23:50 [bug#29035] .bashrc updates Marius Bakke
2017-10-27 23:53 ` [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc Marius Bakke
2017-10-27 23:53 ` [bug#29035] [PATCH 2/2] skel: Return early from .bashrc when the shell is non-interactive Marius Bakke
2017-10-28 7:59 ` Ludovic Courtès
2017-10-28 7:57 ` [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc Ludovic Courtès
2017-10-29 10:17 ` Marius Bakke
2017-10-29 14:24 ` Ludovic Courtès
2017-10-29 20:07 ` Marius Bakke
2017-10-29 21:26 ` Ludovic Courtès [this message]
2017-11-01 20:38 ` bug#29035: " Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2tl1w93.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=29035@debbugs.gnu.org \
--cc=mbakke@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.