bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use of --rcfile does not preclude read of /etc/bash.bashrc


From: Nat!
Subject: Use of --rcfile does not preclude read of /etc/bash.bashrc
Date: Wed, 3 Jan 2018 00:05:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib  -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/bash-IrsGKQ/bash-4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -no-pie -Wno-parentheses -Wno-format-security uname output: Linux terodde 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.4
Patch Level: 12
Release Status: release

Description:
    The documentation states, that /etc/bash.bashrc should not be read (rightfully so IMO) with
    --rcfile.

       --rcfile file
              Execute  commands  from file instead of the system wide initialization file /etc/bash.bashrc and the               standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below).

    Yet it does and it pollutes my values.

Repeat-By:
nat@terodde:/tmp$     echo 'echo $PS1' > x.sh
nat@terodde:/tmp$     echo 'exit' >> x.sh
nat@terodde:/tmp$     PS1='>>>' strace -o trace bash --noprofile --rcfile x.sh
${debian_chroot:+($debian_chroot)}\u@\h:\w\$
nat@terodde:/tmp$ grep bashrc trace
openat(AT_FDCWD, "/etc/bash.bashrc", O_RDONLY) = 3
read(3, "# System-wide .bashrc file for i"..., 2188) = 2188

Ciao

   Nat!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]