[debhelper-devel] [debhelper] 02/03: Avoid shell when calling file+objdump

Niels Thykier nthykier at moszumanska.debian.org
Thu Aug 3 19:35:51 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 b52c315754efa6151bab0e8320eb7a00261e1231
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Aug 3 19:33:23 2017 +0000

    Avoid shell when calling file+objdump
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_makeshlibs | 3 ++-
 dh_shlibdeps  | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dh_makeshlibs b/dh_makeshlibs
index e44930f..3def321 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -167,8 +167,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	open (FIND, "find $tmp -type f \\( -name '*.so' -or -name '*.so.*' \\) $exclude | LC_ALL=C sort |");
 	while (<FIND>) {
 		my ($library, $major);
+		chomp;
 		push @lib_files, $_;
-		my $ret=`$objdump -p $_`;
+		my $ret=qx_cmd($objdump, '-p', $_);
 		if ($ret=~m/\s+SONAME\s+(.*)\.so\.(.*)/) {
 			# proper soname format
 			$library=$1;
diff --git a/dh_shlibdeps b/dh_shlibdeps
index 0e847c6..8e7c234 100755
--- a/dh_shlibdeps
+++ b/dh_shlibdeps
@@ -125,7 +125,7 @@ on_pkgs_in_parallel {
 			next if $file=~m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul|\.build-id)/!;
 			# TODO this is slow, optimize. Ie, file can run once on
 			# multiple files..
-			$ff=`file "$file"`;
+			$ff=qx_cmd('file', $file);
 			if ($ff=~m/ELF/ && $ff!~/statically linked/) {
 				push @filelist,$file;
 			}

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