This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In vms.c's Perl_opendir, skip access check on remotes.
authorCraig A. Berry <craigberry@mac.com>
Sat, 25 Jan 2014 15:52:09 +0000 (09:52 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 25 Jan 2014 16:55:13 +0000 (10:55 -0600)
commit0f669c9d195bffa8ed03ffc8a452415a7246a942
treef5debb06c6f97f58ba0551c0a4435b95633b16eb
parent4b22688e5c51dea3e913d630e965389c5c029765
In vms.c's Perl_opendir, skip access check on remotes.

As reported in [perl #121002], the homegrown opendir has been
failing when the directory specification contains a DECNet node
specification indicating the directory to be accessed is on a
remote node.  The OP reports this worked with Perl 5.001 but not
5.8.6 or 5.18.2.

It appears that the culprit was the introduction of access
checking to Perl_opendir in 61bb59065bf1b12edab39b12, which would
first have been released in 5.004.  Yes, it's been broken for 17
years.

The reason access checking broke remote access is that it's based
on SYS$CHECK_ACCESS, which apparently does not work on remotes,
though the only hint of that in its documentation is that the
status SS$_UNSUPPORTED, "Operations on remote object are not
supported" is listed as a possible return value.  What it actually
returns, despite the documentation, is SS$_INVFILFOROP, "invalid
file specification for operation."

The fix is simple enough -- just skip the access check if the
directory name contains a node specification (which always ends
with "::").  All the access check is providing is a friendlier
error message in cases where we don't have access, so no harm is
done by skipping the check in cases where it can't work.
vms/vms.c