From b07ecbf9f7070a4ffa084b0805f682af878101e9 Mon Sep 17 00:00:00 2001 From: codehelp Date: Thu, 23 Dec 2010 11:56:32 +0000 Subject: [PATCH] change to improve Secure Apt support - needs more testing. git-svn-id: http://emdebian.org/svn/current@7701 563faec7-e20c-0410-992a-a66f704d0ccd --- multistrap | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/multistrap b/multistrap index c4f9334..e74ffb2 100755 --- a/multistrap +++ b/multistrap @@ -271,7 +271,7 @@ if ((defined $k) and (not defined $noauth)) { system ("$str apt-get -y -d --reinstall install $k"); foreach my $keyring_pkg (values %keyrings) { my @files=(); - my $file = `find /var/cache/apt/archives/ -name "$keyring_pkg*"`; + my $file = `find /var/cache/apt/archives/ -name "$keyring_pkg*"|grep -m1 $keyring_pkg`; chomp ($file); if ($file eq "") { my $msg = sprintf (_g("Unable to download keyring package: '%s'"),$dir); @@ -291,6 +291,11 @@ if ((defined $k) and (not defined $noauth)) { "--homedir=${dir}/etc/apt/trusted.gpg.d/ ". "--keyring=multistrap.gpg ". " --import ${xdir}/usr/share/keyrings/${gpg} 2>/dev/null"); + if (-f "${dir}/etc/apt/trusted.gpg.d/multistrap.gpg") { + system ("cp ${dir}/etc/apt/trusted.gpg.d/multistrap.gpg ${dir}/etc/apt/trusted.gpg.d/trustdb.gpg"); + } else { + die (_g("Secure Apt handling failed - try without authentication.")); + } } system ("rm -rf ${xdir}"); }