The default algorithm used by 'pwd' scans the parent directory, and then try to locate the basename by reading entries one by one. If the basename happens to be gobohidden, then this obviously will not work. So, if the algorithm failed to find that entry, we just fall back to the other method, based on lstat, and try to locate it once again. Signed-off-by: Lucas C. Villa Real --- coreutils-6.12/src/pwd.c.orig 2008-10-10 12:20:00.000000000 -0300 +++ coreutils-6.12/src/pwd.c 2008-10-10 12:21:33.000000000 -0300 @@ -167,6 +167,7 @@ find_dir_entry (struct stat *dot_sb, str can't rely on d_ino for useful i-node numbers; use lstat instead. */ use_lstat = (parent_sb.st_dev != dot_sb->st_dev); +loop_start: found = false; while (1) { @@ -223,6 +224,15 @@ find_dir_entry (struct stat *dot_sb, str quote (nth_parent (parent_height))); } + if ( ! found && ! use_lstat) { + /* + * Gobohide fix: we obviously cannot find a hidden entry, + * so fallback to lstat method. + */ + use_lstat = 1; + goto loop_start; + } + if ( ! found) error (EXIT_FAILURE, 0, _("couldn't find directory entry in %s with matching i-node"),