[debhelper-devel] [debhelper] 02/02: dh: Avoid unintended shell in run()

Niels Thykier nthykier at moszumanska.debian.org
Sun Jul 30 10:34:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 76231df3b32e3cdf4155e99c19ca4af7b59eb09c
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Jul 30 10:32:16 2017 +0000

    dh: Avoid unintended shell in run()
    
    Anything relying on this would fail under -B or -A builds, so abuse
    should have been weeded out by now.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog | 2 ++
 dh               | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7798742..c796ed9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ debhelper (10.7.1) UNRELEASED; urgency=medium
 
   * Dh_Lib: Fix doit's new call to ensure it does not call a shell
     (like the documentation promises).
+  * dh: Ensure that we do not fork a shell for running a simple
+    command.
 
  -- Niels Thykier <niels at thykier.net>  Sun, 30 Jul 2017 10:27:46 +0000
 
diff --git a/dh b/dh
index fdf0bcf..091b353 100755
--- a/dh
+++ b/dh
@@ -803,8 +803,8 @@ sub run {
 	}
 
 	return if $dh{NO_ACT};
-			
-	my $ret=system($command, @options);
+
+	my $ret=system { $command } $command, @options;
 	if ($ret >> 8 != 0) {
 		exit $ret >> 8;
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list