Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-11-28 Thread Chet Ramey
On 11/27/17 4:00 PM, Mikulas Patocka wrote: > Will you commit my patch? - if you agree with it. I believe it's a good idea to restrict importing values of OLDPWD to directories, but I will provide a configuration option (config-top.h for now) to optionally disable it. Chet -- ``The lyf so shor

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-11-28 Thread Eduardo Bustamante
On Mon, Nov 27, 2017 at 6:00 PM, Mikulas Patocka wrote: [...] > Will you commit my patch? - if you agree with it. Hi Mikulas. Chet is the one and only bash maintainer, you'd have to convince him. As a bystander that happens to be interested in bash's development, I agree with your points, but ex

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-11-27 Thread Mikulas Patocka
On Wed, 4 Oct 2017, Eduardo A. Bustamante López wrote: > On Tue, Oct 03, 2017 at 10:29:08PM +0200, Mikulas Patocka wrote: > > If $OLDPWD points to a non-existing directory, 'cd -' will fail. > > But if we clear $OLDPWD, 'cd -' will fail too (with just different message). > [...] > > I performed

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-10-04 Thread Eduardo A . Bustamante López
On Tue, Oct 03, 2017 at 10:29:08PM +0200, Mikulas Patocka wrote: > If $OLDPWD points to a non-existing directory, 'cd -' will fail. > But if we clear $OLDPWD, 'cd -' will fail too (with just different message). [...] I performed the following tests: dualbus@ubuntu:~$ for sh in mksh ksh93 das

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-10-03 Thread Mikulas Patocka
On Tue, 3 Oct 2017, Chet Ramey wrote: > On 10/3/17 4:14 PM, Mikulas Patocka wrote: > > > > > > On Sun, 1 Oct 2017, Chet Ramey wrote: > > > >> On 9/30/17 4:20 AM, Mikulas Patocka wrote: > >> > >>> Is there some reason why do we need to check if $OLDPWD is a real > >>> directory? dash and ksh

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-10-03 Thread Chet Ramey
On 10/3/17 4:14 PM, Mikulas Patocka wrote: > > > On Sun, 1 Oct 2017, Chet Ramey wrote: > >> On 9/30/17 4:20 AM, Mikulas Patocka wrote: >> >>> Is there some reason why do we need to check if $OLDPWD is a real >>> directory? dash and ksh accept the $OLDPWD variable, but don't poke it >>> with th

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-10-03 Thread Mikulas Patocka
On Sun, 1 Oct 2017, Chet Ramey wrote: > On 9/30/17 4:20 AM, Mikulas Patocka wrote: > > > Is there some reason why do we need to check if $OLDPWD is a real > > directory? dash and ksh accept the $OLDPWD variable, but don't poke it > > with the stat syscall. zsh clears $OLDPWD. > > It makes no

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-10-01 Thread Chet Ramey
On 9/30/17 4:20 AM, Mikulas Patocka wrote: > Is there some reason why do we need to check if $OLDPWD is a real > directory? dash and ksh accept the $OLDPWD variable, but don't poke it > with the stat syscall. zsh clears $OLDPWD. It makes no sense to inherit it if it doesn't name a directory (or

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-10-01 Thread Mikulas Patocka
On Sat, 30 Sep 2017, L A Walsh wrote: > > > Mikulas Patocka wrote: > > I don't set up OLDPWD in /etc/profile. > --- >No one does -- unless someone is trying to cause mischief. It's not > a likely event, but it would be annoying if someone did it. >But, FWIW, -- it seems like not usin

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-30 Thread L A Walsh
Mikulas Patocka wrote: I don't set up OLDPWD in /etc/profile. --- No one does -- unless someone is trying to cause mischief. It's not a likely event, but it would be annoying if someone did it. But, FWIW, -- it seems like not using 'tainted' values from the environment in a LOGIN SHE

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-30 Thread Mikulas Patocka
On Fri, 29 Sep 2017, Eduardo A. Bustamante López wrote: > On Fri, Sep 29, 2017 at 11:12:59AM +0200, Mikulas Patocka wrote: > > This patch doesn't revert the above change. It only removes a test if > > $OLDPWD is a directory. With this patch, if $OLDPWD points to a directory, > > there will be

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-30 Thread Mikulas Patocka
On Fri, 29 Sep 2017, L A Walsh wrote: > Chet Ramey wrote: > > > > This is all correct. The change was introduced for a reason, and > > accommodating a rare occurrence by backing it out would be non- > > productive. > > > --- > The reason?: > > Why does bash clear OLDPWD when a child script

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-30 Thread Mikulas Patocka
On Fri, 29 Sep 2017, Eduardo A. Bustamante López wrote: > On Fri, Sep 29, 2017 at 12:51:37AM -0700, L A Walsh wrote: > [...] > > Why does bash clear OLDPWD when a child script is started? > > > > OLDPWD is exported and passed to any children, but bash apparently clears > > OLDPWD whenever a chi

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread Chet Ramey
On 9/29/17 5:12 AM, Mikulas Patocka wrote: > > > On Thu, 28 Sep 2017, Eduardo A. Bustamante López wrote: > >> On Thu, Sep 28, 2017 at 11:44:02AM +0200, Mikulas Patocka wrote: >> [...] >>> +++ bash/variables.c >>> @@ -899,7 +899,7 @@ set_pwd () >>> don't find OLDPWD in the environment, or i

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread L A Walsh
Eduardo � wrote: On Fri, Sep 29, 2017 at 12:51:37AM -0700, L A Walsh wrote: Why does bash clear OLDPWD when a child script is started? OLDPWD is exported and passed to any children, but bash apparently clears OLDPWD whenever a child script is started... GNU bash, version 4.1.2(1)-release (x

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread Eduardo A . Bustamante López
On Fri, Sep 29, 2017 at 12:51:37AM -0700, L A Walsh wrote: [...] > Why does bash clear OLDPWD when a child script is started? > > OLDPWD is exported and passed to any children, but bash apparently clears > OLDPWD whenever a child script is started... > > GNU bash, version 4.1.2(1)-release (x86_64

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread Eduardo A . Bustamante López
On Fri, Sep 29, 2017 at 11:12:59AM +0200, Mikulas Patocka wrote: > This patch doesn't revert the above change. It only removes a test if > $OLDPWD is a directory. With this patch, if $OLDPWD points to a directory, > there will be no change, and if $OLDPWD points to non-directory, it will > not b

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread Mikulas Patocka
On Fri, 29 Sep 2017, Mikulas Patocka wrote: > > > On Thu, 28 Sep 2017, Eduardo A. Bustamante López wrote: > > > On Thu, Sep 28, 2017 at 11:44:02AM +0200, Mikulas Patocka wrote: > > [...] > > > +++ bash/variables.c > > > @@ -899,7 +899,7 @@ set_pwd () > > > don't find OLDPWD in the envir

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread Mikulas Patocka
On Thu, 28 Sep 2017, Eduardo A. Bustamante López wrote: > On Thu, Sep 28, 2017 at 11:44:02AM +0200, Mikulas Patocka wrote: > [...] > > +++ bash/variables.c > > @@ -899,7 +899,7 @@ set_pwd () > > don't find OLDPWD in the environment, or it doesn't name a directory, > > make a dummy in

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-29 Thread L A Walsh
Chet Ramey wrote: This is all correct. The change was introduced for a reason, and accommodating a rare occurrence by backing it out would be non- productive. --- The reason?: Why does bash clear OLDPWD when a child script is started? OLDPWD is exported and passed to any children, but bas

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-28 Thread Chet Ramey
On 9/28/17 11:14 AM, Eduardo A. Bustamante López wrote: > This patch would revert the change introduced in: > > http://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=e6f5e0c858b7c0839d346d7d55e56894648c5a33 > > Which was prompted by the following bug report from John Wiersba: > https:

Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory

2017-09-28 Thread Eduardo A . Bustamante López
On Thu, Sep 28, 2017 at 11:44:02AM +0200, Mikulas Patocka wrote: [...] > +++ bash/variables.c > @@ -899,7 +899,7 @@ set_pwd () > don't find OLDPWD in the environment, or it doesn't name a directory, > make a dummy invisible variable for OLDPWD, and mark it as exported. */ >temp_var