From nobody Mon May 6 22:17:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580141549362776.3492294727871; Mon, 27 Jan 2020 08:12:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411--rL8gBYpOfuognmoV3214w-1; Mon, 27 Jan 2020 11:12:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B2521902EA9; Mon, 27 Jan 2020 16:12:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D32E5C1D6; Mon, 27 Jan 2020 16:12:19 +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 2E2658578A; Mon, 27 Jan 2020 16:12:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00RGCGCr006166 for ; Mon, 27 Jan 2020 11:12:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id EE60D60C05; Mon, 27 Jan 2020 16:12:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-52.ams2.redhat.com [10.36.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0850560BFB; Mon, 27 Jan 2020 16:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580141548; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aKWC/R5DDj+ixxEXgjx8FdJ1k0FKomw08U4u6PnPctA=; b=G+uSYQLSTVeAIuYi9bOo7LkhTvB1bBtCeggy2wnzw7mdH7V1Io0dhlhCMl88YFH0GKtIvB ntAlYdCl8ff1Zsb5t3hjGqsZcTFNmmGyYxFrSg46Jb1RfdE1hQag03N4KKjRlMtWqBmdhz zIRhxfcnblL4+fPYASysZhXtOufOKz4= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [hooks PATCH] Don't allow @localhost email addresses in commit message Date: Mon, 27 Jan 2020 16:12:10 +0000 Message-Id: <20200127161210.1438004-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: -rL8gBYpOfuognmoV3214w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: at the very least) or replace the match with something --- update | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/update b/update index 247b008..966fe22 100755 --- a/update +++ b/update @@ -264,6 +264,19 @@ if [ $check_diff =3D yes ]; then fi done fi + + allow_localhost_email=3D$(git config --bool hooks.allowlocalhostemail) + if [ "$allow_localhost_email" !=3D "true" ]; then + for rev in `git log --format=3D%h $oldrev..$newrev` + do + git show $rev | grep '@localhost' >/dev/null 2>&1 + if test $? !=3D 0 + then + echo "*** Update hook: @localhost email address is forbidden $rev" >&2 + exit 1 + fi + done + fi fi =20 # --- Finished --=20 2.24.1