[debhelper-devel] [debhelper] 01/02: Dh_Lib: Force doit to not use shells with exec

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 e2c420df3aa600c6af1c734970227c2ee2a90e90
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Jul 30 10:29:13 2017 +0000

    Dh_Lib: Force doit to not use shells with exec
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm | 4 +++-
 debian/changelog           | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 6e8c630..60a5422 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -325,7 +325,9 @@ sub _doit {
 				open(STDOUT, '>', $output) or error("redirect STDOUT failed: $!");
 			}
 		}
-		exec(@cmd);
+		# Force execvp call to avoid shell.  Apparently, even exec can
+		# involve a shell if you don't do this.
+		exec { $cmd[0] } @cmd;
 	}
 	return waitpid($pid, 0) == $pid && $? == 0;
 }
diff --git a/debian/changelog b/debian/changelog
index 5d370f8..7798742 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+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).
+
+ -- Niels Thykier <niels at thykier.net>  Sun, 30 Jul 2017 10:27:46 +0000
+
 debhelper (10.7) unstable; urgency=medium
 
   [ Niels Thykier ]

-- 
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