diff -Nru os-autoinst-4.5.1527308405.8b586d5/debian/changelog os-autoinst-4.5.1527308405.8b586d5/debian/changelog --- os-autoinst-4.5.1527308405.8b586d5/debian/changelog 2019-01-06 06:22:32.000000000 +0000 +++ os-autoinst-4.5.1527308405.8b586d5/debian/changelog 2019-02-25 19:01:55.000000000 +0000 @@ -1,3 +1,10 @@ +os-autoinst (4.5.1527308405.8b586d5-4.1) unstable; urgency=medium + + * Non-maintainer upload + * Add patch to avoid race condition in osutils::runcmd (Cloese: #921757) + + -- Hilko Bengen Mon, 25 Feb 2019 20:01:55 +0100 + os-autoinst (4.5.1527308405.8b586d5-4) unstable; urgency=medium * debian/control diff -Nru os-autoinst-4.5.1527308405.8b586d5/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch os-autoinst-4.5.1527308405.8b586d5/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch --- os-autoinst-4.5.1527308405.8b586d5/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch 1970-01-01 00:00:00.000000000 +0000 +++ os-autoinst-4.5.1527308405.8b586d5/debian/patches/0006-Eliminate-race-condition-in-runcmd.patch 2019-02-25 19:01:55.000000000 +0000 @@ -0,0 +1,45 @@ +From: Hilko Bengen +Date: Mon, 25 Feb 2019 09:47:35 +0100 +Subject: Eliminate race condition in runcmd + +--- + osutils.pm | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +diff --git a/osutils.pm b/osutils.pm +index b06a042..05423c3 100644 +--- a/osutils.pm ++++ b/osutils.pm +@@ -93,19 +93,10 @@ sub quote { + # Open a process to run external program and check its return status + sub runcmd { + diag "running " . join(' ', @_); +- my ($pid, $status); +- +- local $SIG{CHLD} = sub { +- local ($!, $?); +- while ((my $child = waitpid(-1, WNOHANG)) > 0) { +- diag "runcmd pid $pid returned $child"; +- $status = $?; +- } +- }; + + my ($wtr, $rdr, $err); + $err = gensym; +- $pid = open3($wtr, $rdr, $err, @_); ++ my $pid = open3($wtr, $rdr, $err, @_); + die "couldn't open: $!" unless defined $pid; + close($wtr) or die "couldn't close fh: $!"; + +@@ -125,6 +116,11 @@ sub runcmd { + close($rdr) or die "couldn't close fh: $!"; + close($err) or die "couldn't close fh: $!"; + ++ my $status; ++ waitpid $pid, 0; ++ $status = $?; ++ diag "runcmd pid $pid returned $status"; ++ + my $exit_code = $status >> 8; + die "runcmd failed with exit code $exit_code" unless ($exit_code == 0); + return $exit_code; diff -Nru os-autoinst-4.5.1527308405.8b586d5/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch os-autoinst-4.5.1527308405.8b586d5/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch --- os-autoinst-4.5.1527308405.8b586d5/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch 1970-01-01 00:00:00.000000000 +0000 +++ os-autoinst-4.5.1527308405.8b586d5/debian/patches/0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch 2019-02-25 19:01:55.000000000 +0000 @@ -0,0 +1,28 @@ +From: Hilko Bengen +Date: Mon, 25 Feb 2019 20:21:55 +0100 +Subject: Do not syntax-check module files that start with a dot (such as .pc) + +--- + t/00-compile-check-all.t | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/t/00-compile-check-all.t b/t/00-compile-check-all.t +index 41896f7..f344853 100755 +--- a/t/00-compile-check-all.t ++++ b/t/00-compile-check-all.t +@@ -36,6 +36,7 @@ my $test = Test::Compile->new(); + my @files = $test->all_pm_files("."); + + for my $file (@files) { ++ next if ($file =~ /^[.]/); + next if ($file =~ /main.pm/); + $file =~ s,^\./,,; + $test->ok($test->pm_file_compiles($file), "Compile test for $file"); +@@ -43,6 +44,7 @@ for my $file (@files) { + + @files = ('isotovideo', $test->all_pl_files(".")); + for my $file (@files) { ++ next if ($file =~ /^[.]/); + $test->ok($test->pl_file_compiles($file), "Compile test for $file"); + } + $test->done_testing(); diff -Nru os-autoinst-4.5.1527308405.8b586d5/debian/patches/series os-autoinst-4.5.1527308405.8b586d5/debian/patches/series --- os-autoinst-4.5.1527308405.8b586d5/debian/patches/series 2019-01-06 06:22:32.000000000 +0000 +++ os-autoinst-4.5.1527308405.8b586d5/debian/patches/series 2019-02-25 19:01:55.000000000 +0000 @@ -3,3 +3,5 @@ 0003-adjust-to-avoid-ocr-test-failure.patch 0004-avoid-make-check-doc-failure.patch 0005-set-perl-path.patch +0006-Eliminate-race-condition-in-runcmd.patch +0007-Do-not-syntax-check-module-files-that-start-with-a-d.patch