Skip to content

Commit

Permalink
pbuild: do not trust the repository data comming from an OBS instance
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Sep 20, 2023
1 parent 5d7646c commit 935c03d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion PBuild/OBS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,15 @@ sub fetch_repodata {
unlink("$tmpdir/repository.data");
PBuild::Cpio::cpio_extract("$tmpdir/repository.cpio", "$tmpdir/repository.data", 'extract' => 'repositorycache', 'missingok' => 1);
my $rdata;
$rdata = PBuild::Util::retrieve("$tmpdir/repository.data") if -s "$tmpdir/repository.data";
if (-s "$tmpdir/repository.data") {
if (defined $Storable::flags) {
# we do not want to trust the data from the remote OBS server
local $Storable::flags = 0;
$rdata = PBuild::Util::retrieve("$tmpdir/repository.data");
} else {
$rdata = PBuild::Util::retrieve("$tmpdir/repository.data");
}
}
my @bins = grep {ref($_) eq 'HASH' && defined($_->{'name'})} values %{$rdata || {}};
for (@bins) {
if ($_->{'path'} =~ /^\.\.\/([^\/\.][^\/]*\/[^\/\.][^\/]*)$/s) {
Expand Down

0 comments on commit 935c03d

Please sign in to comment.