#694444 /bin/pwd doesn't use getcwd(3)

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
Andrey Rahmatullin
Date:
2012-11-26 14:03:04 UTC
Severity:
normal
#694444#5
Date:
2012-11-26 14:00:17 UTC
From:
To:
In 8.20-3 /bin/pwd doesn't use the libc getcwd implementation, falling back to
the gnulib one. One of the consequences is that /bin/pwd fails when the parent
dir is not readable but this may be a sign of some more severe problems, as I
couldn't find why the system getcwd is not used (I'm not familiar with gnulib
or the coreutils build system).

Points of interest:
- src/pwd.c::main()
- lib/xgetcwd.c
- lib/getcwd.c::__getcwd()

I can only suppose that "#if HAVE_RAW_DECL_GETCWD &&
HAVE_MINIMALLY_WORKING_GETCWD" is false because HAVE_RAW_DECL_* are not
defined, but I don't understand what code should generate these #defines.