unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
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 15:24:44 +0100	[thread overview]
Message-ID: <877eve3uc3.fsf@gnu.org> (raw)
In-Reply-To: <8760ay5kd5.fsf@fastmail.com> (Marius Bakke's message of "Sun, 29 Oct 2017 11:17:10 +0100")

Hi Marius!

Marius Bakke <mbakke@fastmail.com> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Heya,
>>
>> Marius Bakke <mbakke@fastmail.com> skribis:
>>
>>> * gnu/system/shadow.scm (default-skeletons): Instead of testing for
>>> $SSH_CLIENT, check whether '$-' includes the letter 'i'.
>>
>> That’s an improvement indeed, LGTM!
>
> I realized this will source /etc/profile twice when bash is invoked as
> 'bash -l -c foo', which isn't great.  It also assumes /etc/profile
> exists at all, which might not hold true e.g. in a container.

OK.  (Though GuixSD containers do have /etc/profile, don’t they?)

> The main motivation for this commit is to make things like
> 'git-receive-pack', 'rsync' etc work out-of-the-box when installed in
> a user profile.  The test for `cat` was ineffective on OpenSSH since it
> has a default PATH set to "/run/current-system/profile/bin".
>
> I've tested adding ~/.guix-profile/bin to the compiled-in default
> OpenSSH PATH instead, and it works.  WDYT of this series?

OK.

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.

> From fc37dd6dfb6beab9cc4e52de7b7c98946125e7cc Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Sun, 29 Oct 2017 10:31:25 +0100
> Subject: [PATCH 1/3] gnu: openssh: Add user profiles to the default PATH.
>
> * gnu/packages/ssh.scm (openssh)[arguments]<#:configure-flags>: Add
> '~/guix-profile/bin' to '--with-default-path' arguments.
> ---
>  gnu/packages/ssh.scm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
> index 8317f29cd..2aeeeae1e 100644
> --- a/gnu/packages/ssh.scm
> +++ b/gnu/packages/ssh.scm
> @@ -149,7 +149,9 @@ a server that supports the SSH-2 protocol.")
>        #:configure-flags  `("--sysconfdir=/etc/ssh"
>  
>                             ;; Default value of 'PATH' used by sshd.
> -                          "--with-default-path=/run/current-system/profile/bin"
> +                           ,(string-append "--with-default-path="
> +                                           "/run/current-system/profile/bin:"
> +                                           "~/.guix-profile/bin")

If sshd performs tilde expansion, that’s fine with me.

Should we do something similar for lsh and Dropbear?

> From cc817dd809c85571d3e54a226ff16a7a3aa5bdae Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Sun, 29 Oct 2017 11:07:49 +0100
> Subject: [PATCH 2/3] system: Don't try to source /etc/profile in '.bashrc'
>  skeleton.
>
> * gnu/system/shadow.scm (default-skeletons)[bashrc]: Remove test for $SSH_CLIENT.

OK.

> From 53761ac682cf0de4161c40aa7ec5372a2070c2b2 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Sat, 28 Oct 2017 01:19:01 +0200
> Subject: [PATCH 3/3] system: Return early in skeleton '.bashrc' when the shell
>  is non-interactive.
>
> * gnu/system/shadow.scm (default-skeletons)[bashrc]: Test if $- includes the
> letter 'i', and return if it doesn't.

OK.

Thank you!

Ludo’.

  reply	other threads:[~2017-10-29 14:25 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 [this message]
2017-10-29 20:07         ` Marius Bakke
2017-10-29 21:26           ` Ludovic Courtès
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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877eve3uc3.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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).