Re: improper bashrc sourcing with closed stdin

2016-02-21 Thread Chet Ramey
On 2/20/16 4:25 AM, Andrew Gregory wrote:

> Bash Version: 4.3
> Patch Level: 42
> Release Status: release
> 
> Description:
> If run non-interactively with stdin closed and SHLVL=0, bash will
> source ~/.bashrc, due to run_startup_files() thinking that bash is
> being run by rshd.
> 
> Repeat-By:
> 
> #include 
> #include 
> 
> void main(void) {
> close(0);
> setenv("SHLVL", "0", 1);
> execl("/bin/bash", "/bin/bash", "-c", "echo foo", NULL);
> }
> 
> Fix:
> It looks like isnetconn needs to be modified to not count an fd
> that returns EBADF as a socket:

Thanks for the report and fix.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



Re: Bug with BASHOPTS and compatXX-Flags in 4.3 and 4.4 alpha

2016-02-21 Thread Chet Ramey
On 2/19/16 11:52 AM, Vehlow, Jörg wrote:

> when the option compatXX iss et through BASHOPTS, shopt will report it tob
> e set, but it is not applied.

Thanks for the report and fix.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/