+debhelper (3.0.53) unstable; urgency=low
+
+ * dh_strip: run file using a safe pipe open, that will not expose any weird
+ characters in filenames to a shell. Closes: #126491
+ * fixed dh_testdir man page
+
+ -- Joey Hess <joeyh@debian.org> Wed, 26 Dec 2001 21:15:42 -0500
+
debhelper (3.0.52) unstable; urgency=low
* Typo, Closes: #122679
exit;
}
+# I could just use `file $_[0]`, but this is safer
+sub get_file_type {
+ my $file=shift;
+ open (FILE, '-|') # handle all filenames safely
+ || exec('file', $file)
+ || die "can't exec file: $!";
+ my $type=<FILE>;
+ close FILE;
+ return $type;
+}
+
# Check if a file is an elf binary, shared library, or static library,
# for use by File::Find. It'll fill the following 3 arrays with anything
# it finds:
# Does its filename look like a shared library?
if (m/.*\.so.*?/) {
# Ok, do the expensive test.
- my $type=`file $_`;
+ my $type=get_file_type($_);
if ($type=~m/.*ELF.*shared.*/) {
push @shared_libs, $fn;
return;
my (undef,undef,$mode,undef)=stat(_);
if ($mode & 0111) {
# Ok, expensive test.
- my $type=`file $_`;
+ my $type=get_file_type($_);
if ($type=~m/.*ELF.*executable.*/) {
push @executables, $fn;
return;