The bug lies in the process_directory - method of the apt-mirror script.
It is called recursively for every subdirectory while using a global
DIRHANDLE so the DIRHANDLE of the parent directories always gets
overwritten and so the closedir() call tries to close a subdirectory
which has already been closed :D

I have created a little patch for the apt-mirror 0.4.5-1ubuntu1 package:


528a529,530
>     my $dirhandle;
> 
530,531c532,533
<     opendir(DIR, $dir) or die "apt-mirror: can't opendir $dir: $!";
<     foreach (grep { !/^\.$/ && !/^\.\.$/ } readdir(DIR)) {
---
>     opendir($dirhandle, $dir) or die "apt-mirror: can't opendir $dir: $!";
>     foreach (grep { !/^\.$/ && !/^\.\.$/ } readdir($dirhandle)) {
537c539
<     closedir DIR;
---
>     closedir $dirhandle;


Maybe that helps to get the bug fixed :D

-- 
[intrepid alpha1] apt-mirror gives error "closedir() attempted on invalid 
dirhandle DIR at /usr/bin/apt-mirror line 537."
https://bugs.launchpad.net/bugs/244613
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to