Bug#1069978: bash: incorrect value of $BASH for login shells

2024-04-29 Thread Chet Ramey
On 4/28/24 6:18 PM, Gioele Barabucci wrote: On 28/04/24 22:50, Chet Ramey wrote: On 4/28/24 3:07 PM, Gioele Barabucci wrote: $ su -l $USER -s /bin/bash-static -c 'echo $BASH; readlink /proc/$$/exe; head -1z /proc/$$/cmdline; echo' /bin/bash /usr/bin/bash-static

Bug#1069978: bash: incorrect value of $BASH for login shells

2024-04-28 Thread Gioele Barabucci
On 28/04/24 22:50, Chet Ramey wrote: On 4/28/24 3:07 PM, Gioele Barabucci wrote: $ su -l $USER -s /bin/bash-static -c 'echo $BASH; readlink /proc/$$/exe; head -1z /proc/$$/cmdline; echo' /bin/bash /usr/bin/bash-static -bash-static So argv[0] == "-bash-static", which

Bug#1069978: bash: incorrect value of $BASH for login shells

2024-04-28 Thread Chet Ramey
On 4/27/24 6:23 PM, Gioele Barabucci wrote: Package: bash Version: 5.2.21-2 X-Debbugs-CC: bug-b...@gnu.org Hi, bash 5.0 and 5.2 do not set $BASH to the right value when bash is used as the login shell:     $ apt install bash-static     $ getent passwd $USER | cut -d: -f 7     /bin/bash

Bug#1069978: bash: incorrect value of $BASH for login shells

2024-04-28 Thread Chet Ramey
On 4/28/24 3:07 PM, Gioele Barabucci wrote:     $ su -l $USER -s /bin/bash-static -c 'echo $BASH; readlink /proc/$$/exe; head -1z /proc/$$/cmdline; echo'     /bin/bash     /usr/bin/bash-static     -bash-static So argv[0] == "-bash-static", which causes $0 to be set to -bash-static and

Bug#1069978: bash: incorrect value of $BASH for login shells

2024-04-28 Thread Gioele Barabucci
On 28/04/24 20:01, Chet Ramey wrote: On 4/27/24 6:23 PM, Gioele Barabucci wrote: bash 5.0 and 5.2 do not set $BASH to the right value when bash is used as the login shell: $ apt install bash-static $ getent passwd $USER | cut -d: -f 7 /bin/bash $ su $USER -s

Bug#1069978: bash: incorrect value of $BASH for login shells

2024-04-27 Thread Gioele Barabucci
Package: bash Version: 5.2.21-2 X-Debbugs-CC: bug-b...@gnu.org Hi, bash 5.0 and 5.2 do not set $BASH to the right value when bash is used as the login shell: $ apt install bash-static $ getent passwd $USER | cut -d: -f 7 /bin/bash $ su $USER -s /bin/bash-static -c 'echo