aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-09 08:36:31 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-09 08:36:31 +0000
commit0e2c87f188853b1ab36c5c14b98d5706ff716593 (patch)
tree2e280665d08e0ea5894d19660f2d515061f9914e
parent0abe168e6c4f632df38e4642a791359158545c82 (diff)
downloadrpmdrake-0e2c87f188853b1ab36c5c14b98d5706ff716593.tar
rpmdrake-0e2c87f188853b1ab36c5c14b98d5706ff716593.tar.gz
rpmdrake-0e2c87f188853b1ab36c5c14b98d5706ff716593.tar.bz2
rpmdrake-0e2c87f188853b1ab36c5c14b98d5706ff716593.tar.xz
rpmdrake-0e2c87f188853b1ab36c5c14b98d5706ff716593.zip
Filehandle leak (w.r.t. urpmi)
-rwxr-xr-xrpmdrake8
1 files changed, 8 insertions, 0 deletions
diff --git a/rpmdrake b/rpmdrake
index a4a7ebc3..281097eb 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -1326,12 +1326,19 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
gurpm::progress($amount/$total);
}
};
+ my $fh;
my @errors = $urpm->install(
$urpm->{ask_remove},
\%sources_install,
\%sources,
translate_message => 1,
post_clean_cache => 1,
+ callback_open => sub {
+ my ($data, $type, $id) = @_;
+ my $f = $sources_install{$id} || $sources{$id};
+ open $fh, $f or $urpm->{error}(N("unable to access rpm file [%s]", $f));
+ return fileno $fh;
+ },
callback_inst => $callback_inst,
callback_trans => $callback_inst,
callback_close => sub {
@@ -1344,6 +1351,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
push our @Readmes, map {
[ $_, $fullname ]
} grep { /\bREADME(\.$trtype)?\.urpmi$/ } $pkg->files();
+ close $fh;
},
);
gurpm::end();