Skip Menu |

This queue is for tickets about the Cwd CPAN distribution.

Report information
The Basics
Id: 4593
Status: resolved
Priority: 0/
Queue: Cwd

People
Owner: Nobody in particular
Requestors: cs [...] theta-soft.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 2.08_02
  • 2.08_03
  • 2.08
  • 2.08_04
Fixed in: 2.19



Subject: abs_path fails if cwd is not readable
Cwd::abs_path will fail if the current working directory is not readable. The bsd_realpath function in Cwd.xs will try to open the current working directory for reading (if HAS_FCHDIR is set), which must obviously fail. At least, this faulty code is completely unnecessary! The non fchdir variant (using getcwd) will work fine. So please completely remove this nasty "HAS_FCHDIR" stuff, this will fix the bug.
This was fixed for most platforms in 2.18, and for VMS in 2.19.
From: cs [...] theta-soft.de
[KWILLIAMS - Tue Jul 20 23:40:29 2004]: Show quoted text
> This was fixed for most platforms in 2.18, and for VMS in 2.19.
Problem is still present both in Cwd-2.21 and in PathTools-3.01. Excerpt from Cwd.xs: bsd_realpath(path, resolved) { ... #ifdef HAS_FCHDIR int fd; if ((fd = open(".", O_RDONLY)) < 0) { (void)strcpy(resolved, "."); return (NULL); } #else ... #endif ... } Opening the current directory for reading MUST fail if no read permission, so null is returned.
Cwd.pm is now part of the PathTools distribution, I'm clearing out its tickets from the Cwd queue on RT. If the problem still exists, please open a ticket in the PathTools queue, otherwise I'll just assume it's fixed now. Thanks. -Ken