bug-bash
[Top][All Lists]
Advanced

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

Re: Bogus value of variable BASH


From: Piotr Grzybowski
Subject: Re: Bogus value of variable BASH
Date: Tue, 9 Feb 2016 11:56:00 +0100

hi,

 I think the logic behind variables.c:723 get_bash_name is in this
case: put into BASH whatever valid command given to exec -a . E.g.: if
you put exec -a /bin/ksh /bin/bash and /bin/ksh exists and is
executable it will be seen in BASH variable.

sincerely,
pg




On Tue, Feb 9, 2016 at 1:09 AM, David Hunt <address@hidden> wrote:
> 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
> -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4
> -Wformat -Werror=format-security -Wall
> uname output: Linux unknown 3.13.0-77-generic #121-Ubuntu SMP Wed Jan
> 20 10:50:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Bash Version: 4.3
> Patch Level: 11
> Release Status: release
>
> Description:
>         On my notebook running Ubuntu 14.04.3 LTS /bin/sh points to dash, not 
> bash.
>         To get sh behaviour from bash I use the command `exec -a sh 
> /bin/bash'.
>         When I do so bash sets BASH to /bin/sh, which it demonstrably is not.
>         The situation:
>                 address@hidden:~$ ls -l /bin/bash /bin/sh
>                 -rwxr-xr-x 1 root root 1021112 Oct  7  2014 /bin/bash
>                 lrwxrwxrwx 1 root root       4 Feb 19  2014 /bin/sh -> dash
>
> Repeat-By:
>         The demonstration:
>                 address@hidden:~$ exec -a sh /bin/bash
>                 sh-4.3$ [ "$BASH" -ef "/proc/$$/exe" ] || declare -p BASH
>                 declare -- BASH="/bin/sh"
>
> Fix:
>         I'm clueless.
>



reply via email to

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