bug-bash
[Top][All Lists]
Advanced

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

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


From: Mikulas Patocka
Subject: Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory
Date: Sat, 30 Sep 2017 10:20:06 +0200 (CEST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)


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 no change, and if $OLDPWD points to non-directory, it will 
> > not be cleared.
> 
> You're right. It doesn't revert it, but it does make it less useful.

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.

I think that if bash did the same thing as dash and ksh, it would be 
acceptable.

> > Hung mount shouldn't cause problems unless someone is accessing it.
> 
> My reasoning is that if stat()'ing a directory causes everything to
> halt, then perhaps fix the source of that problem?
> 
> There's no reason why bash should make this a special case.

The stat syscall doesn't completely halt - it waits until a timeout. But 
it is still a problem if every bash script is slowed down by the timeout.

Mikulas


reply via email to

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