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: Eduardo A . Bustamante López
Subject: Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory
Date: Thu, 28 Sep 2017 10:14:11 -0500
User-agent: NeoMutt/20170609 (1.8.3)

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 = find_variable ("OLDPWD");
> -  if (temp_var == 0 || value_cell (temp_var) == 0 || file_isdir (value_cell 
> (temp_var)) == 0)
> +  if (temp_var == 0 || value_cell (temp_var) == 0)
>      {
>        temp_var = bind_variable ("OLDPWD", (char *)NULL, 0);

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://lists.gnu.org/archive/html/bug-bash/2015-11/msg00115.html

Correct me if I'm wrong, but a hanged sshfs mount will cause many more
issues, not only with OLDPWD.

I tried the following:

address@hidden:~/test$ ls -l
total 4
drwxr-xr-x 2 dualbus dualbus 4096 sep 28 10:05 host
address@hidden:~/test$ sshfs $host: host
address@hidden:~/test$ ls -ld host
drwxr-xr-x 1 dualbus dualbus 20480 sep 28 08:15 host
address@hidden:~/test$ cd host
address@hidden:~/test/host$ pwd
/home/dualbus/test/host
address@hidden:~/test/host$ cd ..
address@hidden:~/test$ df host | sed "s/$host/<host>/"
Filesystem     1K-blocks     Used Available Use% Mounted on
<host>:     20511592 13003368   6452528  67% /home/dualbus/test/host
address@hidden:~/test$ sudo iptables -A OUTPUT -p tcp -d $host -j DROP
address@hidden:~/test$ ls
^C^C^C^C^C

Also tried:

cd ho<TAB> # hangs
cd host # hangs
ls -l host # hangs

So in my opinion, it's not worth to revert this change given that you'll have
many more troubles with a hanged network filesystem.



reply via email to

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