summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-11-13 20:35:30 +0000
committerNiels Thykier <niels@thykier.net>2018-11-13 20:35:38 +0000
commitfff0f01c4ceb910ec4d0455718a2f60e22463792 (patch)
treecf9aa620456d3111546aa12ffd5d9e93b47920c6
parenta884723efd1b8198f228e1fe173c439494a1d7ee (diff)
downloaddebhelper-fff0f01c4ceb910ec4d0455718a2f60e22463792.tar.gz
Dh_Lib,dh_installman: Reopen stdin for reading in doit/man(1)-check
This make debhelper work when run under nohup(1), which opens stdin for writing. Trivial to test with: dpkg-buildpackage [...] 0>/dev/null (Once you know that you are looking for it). Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog11
-rwxr-xr-xdh_installman2
-rw-r--r--lib/Debian/Debhelper/Dh_Lib.pm1
3 files changed, 13 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 39517595..f69a7edc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+debhelper (11.5.4) UNRELEASED; urgency=medium
+
+ * Dh_Lib.pm: Reopen stdin to read from /dev/null in doit (and its sibling
+ functions) to prevent issues when stdin is open in write-only mode
+ (which is what nohup(1) does). Thanks to Julian Gilbey for reporting
+ the issue and providing a sample patch for it as well.
+ (Closes: #913663)
+ * dh_installman: Ditto.
+
+ -- Niels Thykier <niels@thykier.net> Tue, 13 Nov 2018 20:30:49 +0000
+
debhelper (11.5.3) unstable; urgency=medium
[ Helmut Grohne ]
diff --git a/dh_installman b/dh_installman
index a41d9c8e..96d6c7a5 100755
--- a/dh_installman
+++ b/dh_installman
@@ -272,7 +272,7 @@ on_items_in_parallel(\@all_packages, sub {
});
# Now utf-8 conversion.
-if (defined `man --version`) {
+if (defined `man --version </dev/null`) {
my (@manpages_to_reencode, @issues);
for my $package (@{$dh{DOPACKAGES}}) {
next if is_udeb($package);
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index aa7448bc..482e758e 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -456,6 +456,7 @@ sub _doit {
chdir($dir) or error("chdir(\"${dir}\) failed: $!");
}
}
+ open(STDIN, '<', '/dev/null') or error("redirect STDIN failed: $!");
if (defined(my $output = $options->{stdout})) {
open(STDOUT, '>', $output) or error("redirect STDOUT failed: $!");
}