Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error accessing remote file on OpenVMS using Perl 5.8.6 #13527

Closed
p5pRT opened this issue Jan 14, 2014 · 19 comments
Closed

Error accessing remote file on OpenVMS using Perl 5.8.6 #13527

p5pRT opened this issue Jan 14, 2014 · 19 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 14, 2014

Migrated from rt.perl.org#121002 (status was 'resolved')

Searchable as RT121002$

@p5pRT
Copy link
Author

p5pRT commented Jan 14, 2014

From darlene@integ.com

I am trying to do an opendir from on a remote file on an Integrity OpenVMS 8.4 with the following​:
"WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]"
This command results in the following error message​:

Fatal VMS error (status=2312) at P_ROOT​:[000000]VMS.C;2, line 6705 at ops$perl​:remote_test.pl line 56.
%SYSTEM-W-NOSUCHDEV, no such device available

The command ("dka0​:[soms_ops4.SCHED.DOMAINS]" works locally.

This command worked on Alpha 8.3 using Perl 5.

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2014

From @craigberry

On Tue, Jan 14, 2014 at 8​:58 AM, Darlene Riddle
<perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Darlene Riddle
# Please include the string​: [perl #121002]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121002 >

I am trying to do an opendir from on a remote file on an Integrity OpenVMS 8.4 with the following​:
"WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]"
This command results in the following error message​:

Fatal VMS error (status=2312) at P_ROOT​:[000000]VMS.C;2, line 6705 at ops$perl​:remote_test.pl line 56.
%SYSTEM-W-NOSUCHDEV, no such device available

The command ("dka0​:[soms_ops4.SCHED.DOMAINS]" works locally.

This command worked on Alpha 8.3 using Perl 5.

Can you please post the output of​:

$ perl -"V"

Is there any way you can create a reproducer containing only the
failing opendir statement?

Is there any way you can try this with a recent version of Perl (5.8.6
is nine years old)?

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2014

From darlene@integ.com

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig Berry via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Tuesday, January 14, 2014 8​:28 PM
To​: Riddle, Darlene
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Tue, Jan 14, 2014 at 8​:58 AM, Darlene Riddle <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Darlene Riddle # Please include the string​:
[perl #121002] # in the subject line of all future correspondence
about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121002 >

I am trying to do an opendir from on a remote file on an Integrity OpenVMS 8.4 with the following​:
"WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]"
This command results in the following error message​:

Fatal VMS error (status=2312) at P_ROOT​:[000000]VMS.C;2, line 6705 at ops$perl​:remote_test.pl line 56.
%SYSTEM-W-NOSUCHDEV, no such device available

The command ("dka0​:[soms_ops4.SCHED.DOMAINS]" works locally.

This command worked on Alpha 8.3 using Perl 5.

Can you please post the output of​:

$ perl -"V"

Is there any way you can create a reproducer containing only the failing opendir statement?

Is there any way you can try this with a recent version of Perl (5.8.6 is nine years old)?

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2014

From darlene@integ.com

Hi Craig,

Here is the output for perl-"V"

Summary of my perl5 (revision 5 version 8 subversion 6) configuration​:
  Platform​:
  osname=VMS, osvers=V8.2, archname=VMS_IA64
  uname='VMS psom01 V8.4'
  config_args='-des'
  hint=none, useposix=false, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=undef, bincompat5005=undef
  Compiler​:
  cc='CC/DECC', ccflags ='/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/List/Machine/Show=Expan /NOANSI_ALIAS/float=ieee/i
eee=denorm_results',
  optimize='/List/Machine/Show=Expan',
  cppflags='undef'
  ccversion='70130187', gccversion='', gccosandvers='undef'
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='int', lseeksize=4
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='Link', ldflags ='/NoTrace/Map/Full/Cross'
  libpth=/sys$share /sys$library
  libs=
  perllibs=
  libc=(DECCRTL), so=exe, useshrplib=undef, libperl=undef
  gnulibc_version='undef'
  Dynamic Linking​:
  dlsrc=dl_vms.c, dlext=exe, d_dlsymun=undef, ccdlflags=''
  cccdlflags='', lddlflags='/Share'

Characteristics of this PERLSHR image​:
  Compile-time options​: DEBUGGING
  Built under VMS
  Compiled at Oct 26 2005 16​:16​:32
  %ENV​:
  PERLSHR="PERL_ROOT​:[000000]PERLSHR.EXE"
  PERL_ROOT="DKA0​:[PERL5_8_6.]"
  @​INC​:
  perl_root​:[lib.VMS_IA64.5_8_6]
  perl_root​:[lib]
  perl_root​:[lib.site_perl.VMS_IA64]
  perl_root​:[lib.site_perl]
  /perl_root/lib/site_perl

Attached is a reproducer of the problem.

The HP website only has Perl 5.8.6 available for download for OpenVMS.

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig Berry via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Tuesday, January 14, 2014 8​:28 PM
To​: Riddle, Darlene
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Tue, Jan 14, 2014 at 8​:58 AM, Darlene Riddle <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Darlene Riddle # Please include the string​:
[perl #121002] # in the subject line of all future correspondence
about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121002 >

I am trying to do an opendir from on a remote file on an Integrity OpenVMS 8.4 with the following​:
"WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]"
This command results in the following error message​:

Fatal VMS error (status=2312) at P_ROOT​:[000000]VMS.C;2, line 6705 at ops$perl​:remote_test.pl line 56.
%SYSTEM-W-NOSUCHDEV, no such device available

The command ("dka0​:[soms_ops4.SCHED.DOMAINS]" works locally.

This command worked on Alpha 8.3 using Perl 5.

Can you please post the output of​:

$ perl -"V"

Is there any way you can create a reproducer containing only the failing opendir statement?

Is there any way you can try this with a recent version of Perl (5.8.6 is nine years old)?

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2014

From darlene@integ.com

REM_REP.PL;3

@p5pRT
Copy link
Author

p5pRT commented Jan 16, 2014

From @craigberry

On Wed, Jan 15, 2014 at 7​:51 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

Hi Craig,

Here is the output for perl-"V"

Thanks. That's definitely the HP 5.8.6 kit.

Attached is a reproducer of the problem.

It's not clear to me whether it's failing on the existence check or on
the opendir, so let's break this down a bit further.

To confirm that DECnet is set up and working, do this​:

$ dir WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]

Do the existence check​:

$ perl -e "-e 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' or die $^E;"

Try the opendir​:

$ perl -e "opendir(D, 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]') or die $^E;"

The HP website only has Perl 5.8.6 available for download for OpenVMS.

That is true, and my understanding is they have no plans to provide
any newer kits. The reason I know that is they asked me to produce
kits, which I have done and made available at​:

https://sourceforge.net/projects/vmsperlkit/files

I'm pretty sure 5.18.2 won't crash the way 5.8.6 does, but it's hard
to predict whether it will work or not. I have not used DECnet in
ages, don't even have it installed on most of my systems, and Perl is
not tested with file specifications having node names. But it should
still work.

In any case, if DECnet is set up and working on your system, then the
only possible way forward with Perl is to try a new version than what
you're using.

This command worked on Alpha 8.3 using Perl 5.

Can you be more specific about the Perl version where this last worked?

@p5pRT
Copy link
Author

p5pRT commented Jan 17, 2014

From darlene@integ.com

Craig,

Does the kit include executables or will I have to build the code? If so, I could try download it and change the perl symbol and perl_root logical to point to the newer version.

The older version of perl is

This is perl, version 5.001

  Unofficial patchlevel 1m.

Copyright 1987-1994, Larry Wall

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig Berry via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Thursday, January 16, 2014 10​:14 AM
To​: Riddle, Darlene
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Wed, Jan 15, 2014 at 7​:51 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

Hi Craig,

Here is the output for perl-"V"

Thanks. That's definitely the HP 5.8.6 kit.

Attached is a reproducer of the problem.

It's not clear to me whether it's failing on the existence check or on the opendir, so let's break this down a bit further.

To confirm that DECnet is set up and working, do this​:

$ dir WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]

Do the existence check​:

$ perl -e "-e 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' or die $^E;"

Try the opendir​:

$ perl -e "opendir(D, 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]') or die $^E;"

The HP website only has Perl 5.8.6 available for download for OpenVMS.

That is true, and my understanding is they have no plans to provide any newer kits. The reason I know that is they asked me to produce kits, which I have done and made available at​:

https://sourceforge.net/projects/vmsperlkit/files

I'm pretty sure 5.18.2 won't crash the way 5.8.6 does, but it's hard to predict whether it will work or not. I have not used DECnet in ages, don't even have it installed on most of my systems, and Perl is not tested with file specifications having node names. But it should still work.

In any case, if DECnet is set up and working on your system, then the only possible way forward with Perl is to try a new version than what you're using.

This command worked on Alpha 8.3 using Perl 5.

Can you be more specific about the Perl version where this last worked?

@p5pRT
Copy link
Author

p5pRT commented Jan 17, 2014

From @craigberry

On Thu, Jan 16, 2014 at 9​:21 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

Craig,

Does the kit include executables or will I have to build the code? If so, I could try download it and change the perl symbol and perl_root logical to point to the newer version.

It's a binary kit including executables. You can easily install it
system-wide or locally and give it a try without disturbing your
current Perl installation.

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2014

From darlene@integ.com

Hi Craig,

I missed your questions below the first time.

I installed Perl 5.18.2. "-e" and opendir still failed on a remote host.

DECnet is set up and working correctly. I tried the following tests with the newer version of Perl. Your perl commands do not produce any output to determine whether they worked or not. I ran the reproducer and it failed. I removed the "-e" from the perl script and the opendir command failed also. Both produced the error, " ERROR​: Cannot open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' for input".

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig Berry via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Thursday, January 16, 2014 10​:14 AM
To​: Riddle, Darlene
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Wed, Jan 15, 2014 at 7​:51 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

Hi Craig,

Here is the output for perl-"V"

Thanks. That's definitely the HP 5.8.6 kit.

Attached is a reproducer of the problem.

It's not clear to me whether it's failing on the existence check or on the opendir, so let's break this down a bit further.

To confirm that DECnet is set up and working, do this​:

$ dir WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]

Do the existence check​:

$ perl -e "-e 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' or die $^E;"

Try the opendir​:

$ perl -e "opendir(D, 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]') or die $^E;"

The HP website only has Perl 5.8.6 available for download for OpenVMS.

That is true, and my understanding is they have no plans to provide any newer kits. The reason I know that is they asked me to produce kits, which I have done and made available at​:

https://sourceforge.net/projects/vmsperlkit/files

I'm pretty sure 5.18.2 won't crash the way 5.8.6 does, but it's hard to predict whether it will work or not. I have not used DECnet in ages, don't even have it installed on most of my systems, and Perl is not tested with file specifications having node names. But it should still work.

In any case, if DECnet is set up and working on your system, then the only possible way forward with Perl is to try a new version than what you're using.

This command worked on Alpha 8.3 using Perl 5.

Can you be more specific about the Perl version where this last worked?

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2014

From @craigberry

On Mon, Jan 20, 2014 at 7​:38 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

Hi Craig,

I missed your questions below the first time.

I installed Perl 5.18.2. "-e" and opendir still failed on a remote host.

DECnet is set up and working correctly. I tried the following tests with the newer version of Perl.
Your perl commands do not produce any output to determine whether they worked or not.

If they produce no output, that means they worked. Only failure would
produce an error, such as this on a system without DECNet installed​:

$ perl -e "-e 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' or die $^E;"
%RMS-F-DEV, error in device name or inappropriate device type for
operation at -e line 1.
%RMS-F-DEV, error in device name or inappropriate device type for operation
$ perl -e "opendir(D, 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]') or die $^E;"
%RMS-F-DEV, error in device name or inappropriate device type for
operation at -e line 1.
%RMS-F-DEV, error in device name or inappropriate device type for operation

I ran the reproducer and it failed. I removed the "-e" from the perl script and
the opendir command failed also. Both produced the error, " ERROR​: Cannot
open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' for input".

Since the one-liner examples worked for you, I'm puzzled by why your
reproducer failed. That error message comes from your script and
doesn't include an error reason so it's hard to know what's going on.
Please try the following even simpler script​:

$ type test_remote.pl
use strict;
my $svr_dirname = "WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]";
if (opendir(my $env_dir, $svr_dirname)) {
  print "opendir on $svr_dirname succeeded\n";
}
else {
  die "ERROR​: Cannot open the directory '${svr_dirname}'​: $!";
}

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2014

From darlene@integ.com

Craig,

Here is the result of the test​:

ERROR​: Cannot open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]'​: invalid argument at test_remote.pl line 6.
%SYSTEM-F-ABORT, abort

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig A. Berry [mailto​:craig.a.berry@​gmail.com]
Sent​: Tuesday, January 21, 2014 1​:42 PM
To​: Riddle, Darlene
Cc​: perlbug-followup@​perl.org
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Mon, Jan 20, 2014 at 7​:38 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

Hi Craig,

I missed your questions below the first time.

I installed Perl 5.18.2. "-e" and opendir still failed on a remote host.

DECnet is set up and working correctly. I tried the following tests with the newer version of Perl.
Your perl commands do not produce any output to determine whether they worked or not.

If they produce no output, that means they worked. Only failure would produce an error, such as this on a system without DECNet installed​:

$ perl -e "-e 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' or die $^E;"
%RMS-F-DEV, error in device name or inappropriate device type for operation at -e line 1.
%RMS-F-DEV, error in device name or inappropriate device type for operation $ perl -e "opendir(D, 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]') or die $^E;"
%RMS-F-DEV, error in device name or inappropriate device type for operation at -e line 1.
%RMS-F-DEV, error in device name or inappropriate device type for operation

I ran the reproducer and it failed. I removed the "-e" from the perl
script and the opendir command failed also. Both produced the error, "
ERROR​: Cannot open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]' for input".

Since the one-liner examples worked for you, I'm puzzled by why your reproducer failed. That error message comes from your script and doesn't include an error reason so it's hard to know what's going on.
Please try the following even simpler script​:

$ type test_remote.pl
use strict;
my $svr_dirname = "WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]";
if (opendir(my $env_dir, $svr_dirname)) {
  print "opendir on $svr_dirname succeeded\n"; } else {
  die "ERROR​: Cannot open the directory '${svr_dirname}'​: $!"; }

@p5pRT
Copy link
Author

p5pRT commented Jan 25, 2014

From @craigberry

On Tue, Jan 21, 2014 at 4​:02 PM, Riddle, Darlene <darlene@​integ.com> wrote​:

Craig,

Here is the result of the test​:

ERROR​: Cannot open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]'​: invalid argument at test_remote.pl line 6.
%SYSTEM-F-ABORT, abort

I finally got a test environment set up where I could reproduce this
and see what was going on. I've pushed a fix to the development
sources and included it below as well. This fix will appear in 5.20,
which won't be out for a few months. I'll see about getting it into
5.18.3, which is also probably some months away. I think the only
immediate solution is to build Perl from source with this fix
included.

$ git show 0f669c9
commit 0f669c9
Author​: Craig A. Berry <craigberry@​mac.com>
Date​: Sat Jan 25 09​:52​:09 2014 -0600

  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 61bb590, 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.

Inline Patch
diff --git a/vms/vms.c b/vms/vms.c
index cbc47d2..c0fa4e4 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -9977,7 +9977,8 @@ Perl_opendir(pTHX_ const char *name)
     /* Check access before stat; otherwise stat does not
      * accurately report whether it's a directory.
      */
-    if (!cando_by_name_int(S_IRUSR,0,dir,PERL_RMSEXPAND_M_VMS_IN)) {
+    if (!strstr(dir, "::") /* sys$check_access doesn't do remotes */
+        && !cando_by_name_int(S_IRUSR,0,dir,PERL_RMSEXPAND_M_VMS_IN)) {
       /* cando_by_name has already set errno */
       Safefree(dir);
       return NULL;

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2014

From darlene@integ.com

Thanks, Craig. How much effort is involved in building Perl on OpenVMS 8.4?

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig Berry via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Saturday, January 25, 2014 12​:15 PM
To​: Riddle, Darlene
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Tue, Jan 21, 2014 at 4​:02 PM, Riddle, Darlene <darlene@​integ.com> wrote​:

Craig,

Here is the result of the test​:

ERROR​: Cannot open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]'​: invalid argument at test_remote.pl line 6.
%SYSTEM-F-ABORT, abort

I finally got a test environment set up where I could reproduce this and see what was going on. I've pushed a fix to the development sources and included it below as well. This fix will appear in 5.20, which won't be out for a few months. I'll see about getting it into 5.18.3, which is also probably some months away. I think the only immediate solution is to build Perl from source with this fix included.

$ git show 0f669c9
commit 0f669c9
Author​: Craig A. Berry <craigberry@​mac.com>
Date​: Sat Jan 25 09​:52​:09 2014 -0600

  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 61bb590, 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.

diff --git a/vms/vms.c b/vms/vms.c
index cbc47d2..c0fa4e4 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@​@​ -9977,7 +9977,8 @​@​ Perl_opendir(pTHX_ const char *name)
  /* Check access before stat; otherwise stat does not
  * accurately report whether it's a directory.
  */
- if (!cando_by_name_int(S_IRUSR,0,dir,PERL_RMSEXPAND_M_VMS_IN)) {
+ if (!strstr(dir, "​::") /* sys$check_access doesn't do remotes */
+ && !cando_by_name_int(S_IRUSR,0,dir,PERL_RMSEXPAND_M_VMS_IN)) {
  /* cando_by_name has already set errno */
  Safefree(dir);
  return NULL;

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2014

From darlene@integ.com

I went to the perl download site but I did not see a version for OpenVMS. Can you direct me to the correct version?

How much work will be involved in building perl? I have a C compiler already.

I am trying to make a decision on whether to compile a newer version of Perl or replace the Perl scripts that use a remote node name with DCL scripts (27 scripts in all).

Sincerely,
 
Darlene Riddle
PACS Software Lead
Kratos Technology & Training Solutions
(443) 539-5213
darlene@​integ.com

-----Original Message-----
From​: Craig A. Berry [mailto​:craig.a.berry@​gmail.com]
Sent​: Saturday, January 25, 2014 12​:14 PM
To​: Riddle, Darlene
Cc​: perlbug-followup@​perl.org
Subject​: Re​: [perl #121002] Error accessing remote file on OpenVMS using Perl 5.8.6

On Tue, Jan 21, 2014 at 4​:02 PM, Riddle, Darlene <darlene@​integ.com> wrote​:

Craig,

Here is the result of the test​:

ERROR​: Cannot open the directory 'WSOMSV​::dka200​:[soms_ops4.SCHED.DOMAINS]'​: invalid argument at test_remote.pl line 6.
%SYSTEM-F-ABORT, abort

I finally got a test environment set up where I could reproduce this and see what was going on. I've pushed a fix to the development sources and included it below as well. This fix will appear in 5.20, which won't be out for a few months. I'll see about getting it into 5.18.3, which is also probably some months away. I think the only immediate solution is to build Perl from source with this fix included.

$ git show 0f669c9
commit 0f669c9
Author​: Craig A. Berry <craigberry@​mac.com>
Date​: Sat Jan 25 09​:52​:09 2014 -0600

  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 61bb590, 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.

Inline Patch
diff --git a/vms/vms.c b/vms/vms.c
index cbc47d2..c0fa4e4 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -9977,7 +9977,8 @@ Perl_opendir(pTHX_ const char *name)
     /* Check access before stat; otherwise stat does not
      * accurately report whether it's a directory.
      */
-    if (!cando_by_name_int(S_IRUSR,0,dir,PERL_RMSEXPAND_M_VMS_IN)) {
+    if (!strstr(dir, "::") /* sys$check_access doesn't do remotes */
+        && !cando_by_name_int(S_IRUSR,0,dir,PERL_RMSEXPAND_M_VMS_IN)) {
       /* cando_by_name has already set errno */
       Safefree(dir);
       return NULL;

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2014

From @craigberry

On Mon, Jan 27, 2014 at 8​:58 AM, Riddle, Darlene <darlene@​integ.com> wrote​:

I went to the perl download site but I did not see a version for OpenVMS. Can you direct me to the correct version?

There is no separate source distribution for VMS -- just grab the
latest stable tarball, currently
<http​://www.cpan.org/src/5.0/perl-5.18.2.tar.gz>. Then apply the
small fix from my previous message to [.vms]vms.c.

How much work will be involved in building perl? I have a C compiler already.

You'll also need a tar utility, a gzip utility, and MMK. I believe
all of this is documented at

http​://perl5.git.perl.org/perl.git/blob/HEAD​:/README.vms

I would expect a couple hours to track down and install the various
tools if you don't already have them. After that building Perl should
be pretty easy. Have a look at README.vms and ask if you run into
trouble.

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @mauke

On Sat Jan 25 09​:14​:47 2014, craig.a.berry@​gmail.com wrote​:

I finally got a test environment set up where I could reproduce this
and see what was going on. I've pushed a fix to the development
sources and included it below as well. This fix will appear in 5.20,
which won't be out for a few months. I'll see about getting it into
5.18.3, which is also probably some months away. I think the only
immediate solution is to build Perl from source with this fix
included.

This ticket is listed in perl5200delta. Can it be closed?

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @craigberry

On Mon, Feb 22, 2016 at 4​:29 PM, l.mai@​web.de via RT
<perlbug-followup@​perl.org> wrote​:

On Sat Jan 25 09​:14​:47 2014, craig.a.berry@​gmail.com wrote​:

I finally got a test environment set up where I could reproduce this
and see what was going on. I've pushed a fix to the development
sources and included it below as well. This fix will appear in 5.20,
which won't be out for a few months. I'll see about getting it into
5.18.3, which is also probably some months away. I think the only
immediate solution is to build Perl from source with this fix
included.

This ticket is listed in perl5200delta. Can it be closed?

Yes, and thanks for chasing the cobwebs out of the RT queue.

@p5pRT p5pRT closed this as completed Feb 22, 2016
@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

@mauke - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant