List Info

Thread: File::Path infinite recursion on VMS fix.




File::Path infinite recursion on VMS fix.
user name
2007-08-30 23:35:28
The attached patch file_path_pm.gdiff handles a special case
of a 
filename named "." on VMS that is not a directory.
 If rmtree() is 
called on a directory with this present, it causes an
infinite recursion.

As failed Perl tests on VMS tend to leave a file named
"." behind as a 
result of a file conversion error, a special case is set up
to remove it.

It looks like this could be done more efficiently by moving
the common 
code into a subroutine, but this gets the the immediate
problem fixed.

The longer patch file file_path_pm_ws.gdiff is one that has
the patch 
and converts the tabs to spaces while retaining the correct
indenting, 
and also fixes a few indenting issues.

-John
wb8tywqsl.network
Personal Opinion Only

  
  
Re: File::Path infinite recursion on VMS fix.
user name
2007-08-31 09:25:11
At 11:35 PM -0500 8/30/07, John E. Malmberg wrote:
>The attached patch file_path_pm.gdiff handles a special
case of a filename named "." on VMS that is not a
directory.  If rmtree() is called on a directory with this
present, it causes an infinite recursion.

Good catch.

>It looks like this could be done more efficiently by
moving the common code into a subroutine, but this gets the
the immediate problem fixed.

Well, frankly it looks unnecessarily complex.  I've checked
#31775
into blead instead, which really only adds one line of new 
code.  It
seems to do the trick just fine for me, but let me know if
you have
any trouble with it.

However, File::Path is now pretty different from what's in
blead, so
the attached patch is against 2.00_09.  There we had the
additional
problem that C<-d _> depends on whatever was most
recently stat()ed
successfully inside of catdir, and that might have been a
directory
even when catdir fails to return a directory.  So I moved
the lstat
down to where its result is what the magic underscore sees
rather than
whatever happened or didn't happen inside of catdir.  That
means we
will do a catdir in some cases where we don't use its
result, but we
can probably live with that.
-- 
________________________________________
Craig A. Berry
mailto:craigberrymac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser
  
Re: File::Path infinite recursion on VMS fix.
user name
2007-08-31 09:47:24
Craig A. Berry wrote:
> At 11:35 PM -0500 8/30/07, John E. Malmberg wrote:
>> The attached patch file_path_pm.gdiff handles a
special case of a filename named "." on VMS that
is not a directory.  If rmtree() is called on a directory
with this present, it causes an infinite recursion.
> 
> Good catch.

> Well, frankly it looks unnecessarily complex.  I've
checked #31775
> into blead instead, which really only adds one line of
new  code.  It
> seems to do the trick just fine for me, but let me know
if you have
> any trouble with it.

That looks like it will work.

I think that eventually it will need some more work for VMS
though, 
especially for ODS-5, but first a VMS specific torture test
needs to be 
written for ODS-5.

-John

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )