From patchwork Fri Apr 20 09:45:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Tunnicliffe X-Patchwork-Id: 7973 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7075923E00 for ; Fri, 20 Apr 2012 09:45:20 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1E95FA181D5 for ; Fri, 20 Apr 2012 09:45:20 +0000 (UTC) Received: by iage36 with SMTP id e36so18003243iag.11 for ; Fri, 20 Apr 2012 02:45:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=GE/93JdDhHjvpW5Tpa4AG5B3kkOfNcy8jV+NP+TxBz4=; b=XteuEFPerJBnl9EOEvf1NpoUL0tYV4LbJHb5TzUIIUgs2ke+I49Dww9+haILhBx6z8 aZC4SYNP4ItCa/UraI3RNxqYFxvRPssKT8IHvw/dQHjV4qogANC96lA01RRlqe8US2id Br72/08OrWr25PG1jkLsrywByvnRw+So9PoTqB2k0HdfXeCVmHRo1kowfTv+T8Yvbcaf /XYowIXrdqdQsEC53VXdH+ZbBivnzhDzBPLN40+dGzy46P2zkYa8FVhMTK9+J3G4lJdV S+pTi7YvPmp7kcoqkgOPq+28k5jS/Ci1xa+l6cxAGZa38sq47PJZ1zQlf1ZzY+zJD6Hj AbIg== Received: by 10.50.196.230 with SMTP id ip6mr5084294igc.49.1334915119516; Fri, 20 Apr 2012 02:45:19 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp21773ibt; Fri, 20 Apr 2012 02:45:18 -0700 (PDT) Received: by 10.216.150.199 with SMTP id z49mr3389463wej.59.1334915117461; Fri, 20 Apr 2012 02:45:17 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id bh6si1964710wib.2.2012.04.20.02.45.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Apr 2012 02:45:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1SLAOy-0006jE-UP for ; Fri, 20 Apr 2012 09:45:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id DD416E0259 for ; Fri, 20 Apr 2012 09:45:16 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 510 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 510: Prevent repository private key from entering logs Message-Id: <20120420094516.10548.37216.launchpad@ackee.canonical.com> Date: Fri, 20 Apr 2012 09:45:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15120"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: b08817032eb9423f4bb665cbd88abe8c44e1480e X-Gm-Message-State: ALoCoQnraS1rh3oQv5OPAOzkLzky79iFWKcBQ43ZvBG7jcnOgpKW/kMragLkBHq2trnuQFpb4WlK Merge authors: Ricardo Salveti (rsalveti) Related merge proposals: https://code.launchpad.net/~rsalveti/linaro-image-tools/remove-pkey-log/+merge/102783 proposed by: Ricardo Salveti (rsalveti) review: Approve - James Tunnicliffe (dooferlad) ------------------------------------------------------------ revno: 510 [merge] committer: James Tunnicliffe branch nick: trunk timestamp: Fri 2012-04-20 10:41:35 +0100 message: Prevent repository private key from entering logs modified: linaro_image_tools/hwpack/packages.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro_image_tools/hwpack/packages.py' --- linaro_image_tools/hwpack/packages.py 2011-11-14 13:32:51 +0000 +++ linaro_image_tools/hwpack/packages.py 2012-04-20 00:27:08 +0000 @@ -702,6 +702,9 @@ return fetched.values() acq = apt_pkg.Acquire(DummyProgress()) acqfiles = [] + # re to remove the repo private key + deb_url_auth_re = re.compile( + r"(?P.*://)(?P.*):.*@(?P.*$)") for package in self.cache.cache.get_changes(): if (package.marked_delete or package.marked_keep): continue @@ -717,7 +720,12 @@ acq, candidate.uri, candidate.md5, candidate.size, base, destfile=destfile) acqfiles.append((acqfile, result_package, destfile)) - logger.debug(" ... from %s" % acqfile.desc_uri) + # check if we have a private key in the pkg url + deb_url_auth = deb_url_auth_re.match(acqfile.desc_uri) + if deb_url_auth: + logger.debug(" ... from %s%s:***@%s" % deb_url_auth.groups()) + else: + logger.debug(" ... from %s" % acqfile.desc_uri) self.cache.cache.clear() acq.run() for acqfile, result_package, destfile in acqfiles: