From nobody Fri Apr 19 17:52:02 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547824089593924.5540692555858; Fri, 18 Jan 2019 07:08:09 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43017D4028; Fri, 18 Jan 2019 15:08:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 225E85D78E; Fri, 18 Jan 2019 15:08:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EF61C1803395; Fri, 18 Jan 2019 15:08:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0IF87Eu001193 for ; Fri, 18 Jan 2019 10:08:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 62A595D760; Fri, 18 Jan 2019 15:08:07 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2732A5D6AA; Fri, 18 Jan 2019 15:08:00 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Fri, 18 Jan 2019 16:07:59 +0100 Message-Id: <20190118150759.23954-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Cc: Davide Caratti Subject: [Patchew-devel] [PATCH] dockerfile: fix copying identity file X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Jan 2019 15:08:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The identity file is copied into ~/.ssh but ~/.ssh may not exist. Fix that with mkdir -p. If not using an identity file supplied via ansible, in addition, we should not regenerate it on every deployment; test for id_rsa before creating a new key pair. Reported-by: Davide Caratti Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/dockerfiles/importer.docker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dockerfiles/importer.docker b/scripts/dockerfiles/impo= rter.docker index 953a75b..ab15d45 100644 --- a/scripts/dockerfiles/importer.docker +++ b/scripts/dockerfiles/importer.docker @@ -2,10 +2,10 @@ FROM fedora:latest RUN dnf install -y python offlineimap findutils git wget RUN git config --global user.email "importer@patchew.org" RUN git config --global user.name "Patchew Importer" +RUN mkdir -p -m 0700 ~/.ssh +RUN test -f /data/patchew/id_rsa || ssh-keygen -t rsa -q -C patchew-import= er -f ~/.ssh/id_rsa RUN if test -f /data/patchew/identity; then \ echo IdentityFile=3D/data/patchew/identity > ~/.ssh/config; \ - else \ - ssh-keygen -t rsa -q -C patchew-importer -f ~/.ssh/id_rsa; \ fi RUN echo StrictHostKeyChecking no >> ~/.ssh/config RUN echo UserKnownHostsFile=3D/dev/null >> ~/.ssh/config --=20 2.20.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel