Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15534 > unrolled thread
| Started by | Francis.Montagnac@inria.fr |
|---|---|
| First post | 2019-10-24 09:01 +0200 |
| Last post | 2019-10-24 09:01 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Unexpected sourcing of ~/.bashrc under ssh Francis.Montagnac@inria.fr - 2019-10-24 09:01 +0200
| From | Francis.Montagnac@inria.fr |
|---|---|
| Date | 2019-10-24 09:01 +0200 |
| Subject | Unexpected sourcing of ~/.bashrc under ssh |
| Message-ID | <mailman.1660.1571926700.9715.bug-bash@gnu.org> |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switch\
es -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection \
-fcf-protection -Wno-parentheses -Wno-format-security
uname output: Linux nbrume 5.3.6-200.fc30.x86_64+debug #1 SMP Mon Oct 14 12:47:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu
Bash Version: 5.0
Patch Level: 7
Release Status: release
Description:
When logged on a machine with ssh, executing a simple command CMD1
that spawn a "/bin/bash -c some other command" do not source
~/.bashrc: normal behaviour.
When executing "CMD1 | CMD2", the ~/.bashrc is sourced: wrong .
I have tested that with perl and make as CMD1.
This bug is not present in bash-4.2.48-2.fc14.1.x86_64
Repeat-By:
Add for example in ~/.bashrc:
echo "Sourcing .bashrc, \$- = $-"
connect to this machine with ssh, then execute:
$ perl -e 'exec "/bin/bash","-c","echo foo"'
foo
$ perl -e 'exec "/bin/bash","-c","echo foo"' | cat
Sourcing .bashrc, $- = hBc
foo
$
Turnaround:
For make, defines: SHELL := /bin/bash --norc
Unsetting the SSH_CLIENT variable works also.
--
Francis Montagnac
Back to top | Article view | gnu.bash.bug
csiph-web