From nobody Fri May 3 13:25:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1643319245; cv=none; d=zohomail.com; s=zohoarc; b=B3KP7ye2mYhfMb8dtwxJ2WvYIWENXW0niAKEKEym5R47APcbb1TJpLid/CaP3tQ5QGU7ydJ8qd30NlSTq9B9KkF9FOBVFjMa6feqOcI9Qv0Pu4KYVhN4QLDfd00TBTxT0r5jAHzrOLIIzjfC6zAtFeynSDtmI1H1H/azFhuiNAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643319245; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=evLw9KmxVCxYnbaAabsYvinAoPPHneJTJLVkXsgm6gI=; b=J/U9evDRdF2d08NYS/OFrym1IeuLZnn5ArXBsmAPwi1t2UztpTS1Zo4LuVOFgF0HdGTC9X8g+f5Hk5XqhPxsYfFDWjFMXYVkRzjtk3Q9lsQqXZD0E+rg8SkEgeCvbi39RvzPWMMlgp5/kTizGiujkzoiqpBF5sb8m1jtp6BFENk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 164331924575362.85362105292336; Thu, 27 Jan 2022 13:34:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-462-Q_nXaHt2MriL2svEGE0OmQ-1; Thu, 27 Jan 2022 16:34:01 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A531083DD20; Thu, 27 Jan 2022 21:33:54 +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 86F9C10D1506; Thu, 27 Jan 2022 21:33:51 +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 6C2CF1809CB8; Thu, 27 Jan 2022 21:33:47 +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 20RLXiwi015002 for ; Thu, 27 Jan 2022 16:33:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6953B46970; Thu, 27 Jan 2022 21:33:44 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1CA84697B for ; Thu, 27 Jan 2022 21:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643319245; 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=evLw9KmxVCxYnbaAabsYvinAoPPHneJTJLVkXsgm6gI=; b=i0DkVOQDUO4nHU6PSFrnekjc0JFcq1X2auFo/8C0zN1SR52c/Nh76N6pKjuiL59ww1ss30 PtbgjDyLNDB3GVBVMxgfLUK0cRIv+4urdeU5sGTn0V45Lt6JE9pfWJ7+Jb3Eu9Jl6UtNaA c3I4bnM5qTg+BBLyBV35Dqgec8NvX7c= X-MC-Unique: Q_nXaHt2MriL2svEGE0OmQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH] conf: network: remove hostname validation Date: Thu, 27 Jan 2022 22:33:24 +0100 Message-Id: <7b85a2cea573fbc70c89a7736d2ba8f9d4eaef11.1643319202.git.jtomko@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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643319247677100001 We used to validate that the first character of the hostname is a letter. Later, RFC1123 relaxed the requirements to allow a number as well. Drop the validation completely, since we do not care about the following characters, and neither does dnsmasq (even if it's a comma, which is a delimiter in the hosts file). Reverts: 673b74be5fda928da5e9f3c2cfbf6c1cb1eda0c6 Signed-off-by: J=C3=A1n Tomko --- src/conf/network_conf.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index c769bbaeb5..8f50e22be5 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -548,12 +548,6 @@ virNetworkDHCPHostDefParseXML(const char *networkName, } =20 name =3D virXMLPropString(node, "name"); - if (name && !(g_ascii_isalpha(name[0]) || g_ascii_isdigit(name[0]))) { - virReportError(VIR_ERR_XML_ERROR, - _("Cannot use host name '%s' in network '%s'"), - name, networkName); - return -1; - } =20 ip =3D virXMLPropString(node, "ip"); if (ip && (virSocketAddrParse(&inaddr, ip, AF_UNSPEC) < 0)) { --=20 2.31.1