develooper Front page | perl.vmsperl | Postings from January 2002

Re: Privileges won't let me "opendir"?

From:
Craig A. Berry
Date:
January 30, 2002 09:51
Subject:
Re: Privileges won't let me "opendir"?
Message ID:
5.1.0.14.2.20020130112725.01ad2cb8@mail.mac.com
At 02:24 PM 1/29/2002 -0800, Brad Hughes wrote:
>Tom Edelson wrote:
>
>>Under the same conditions (BYPASS on, so DCL can read it, but I don't otherwise have access):
>>  $ perl -e "$z = opendir($dh,'[.temp]'); print qq([$!][$^E][$z]\n)"
>>  [permission denied][%RMS-E-PRV, insufficient privilege or file protection violation][]
>>/ Tom
>>P.S.  VMS Version V7.2-2 
>
>
>I'm on VMS V7.1-2.  This is weird.  Can anyone else out there
>provide a data point?


On OpenVMS Alpha 7.2-1, Perl 5.6.1, starting with BYPASS on:

$ dir/sec temp.dir

Directory D0:[CRAIG]

TEMP.DIR;1           [1,1]                            (RWE,RWE,RE,E)

Total of 1 file.
$ perl -e "$z = opendir($dh,'[.temp]'); print qq([$!][$^E][$z]\n)"
[permission denied][%RMS-E-PRV, insufficient privilege or file protection violation][]
$ set proc/priv=nobypass
$ perl -e "$z = opendir($dh,'[.temp]'); print qq([$!][$^E][$z]\n)"
[not a directory][%RMS-F-DIR, error in directory name][]

So there may well be 2 bugs here, one related to getting the wrong error 
when we don't have privileges and one related to not getting access when we 
do have privs.  It appears not to be opendir per se, but the access checking 
routine, this based on the fact that the directory is not considered 
readable even when BYPASS is enabled:

$ perl -e "print -d 'temp.dir';"
1
$ perl -e "print -r 'temp.dir';"
$ 

I will try to put together a debug build and step through cando_by_name().  
I don't see anything obvious just browsing the code.  The same problem still 
exists in bleadperl.  Thanks for the report, Tom.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About