From nobody Sun May 19 17:22:33 2024 Delivered-To: importer@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=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524533317534906.428154527073; Mon, 23 Apr 2018 18:28:37 -0700 (PDT) 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 081D383F45; Tue, 24 Apr 2018 01:28:34 +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 3583674954; Tue, 24 Apr 2018 01:28:31 +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 600614CA9F; Tue, 24 Apr 2018 01:28:27 +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 w3O1Rc48013196 for ; Mon, 23 Apr 2018 21:27:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1D2074954; Tue, 24 Apr 2018 01:27:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAAE27493F for ; Tue, 24 Apr 2018 01:27:36 +0000 (UTC) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29B7F5D675 for ; Tue, 24 Apr 2018 01:27:25 +0000 (UTC) Received: by mail-qt0-f196.google.com with SMTP id d3-v6so20075770qth.8 for ; Mon, 23 Apr 2018 18:27:25 -0700 (PDT) Received: from localhost.localdomain ([191.190.189.132]) by smtp.gmail.com with ESMTPSA id o14-v6sm7317831qta.23.2018.04.23.18.27.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 18:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=yJiS9C5fDDbD91wazdMZk/z04HM1Pe9z5nwu5g3IHxo=; b=ew7UakJzMkJ2nWt093j3nEuuYXjjZq/1JSXiR55t/WI+VZGBhKJrJ2ijwDTksRLz8i qPqY8KisJcpzQpR1VVOYmYjYRyaa6uR1nBszH+HKie+nmg51qLQeMw2Su3f5mloRR02S Kzi6prIsQ5hNOJG/bdb4fjIxeqHagPuHLNoJYjjpiy0YhhKV7VeCsz6OquYbe6/t75Fk GxA1pBdyFa4JCOSt7RD3WMTzbgqXyHeJzmAtBICAwvyZjbkbL5HX6tW1BgKlqa4+lW5J 2FmRsPYr6MVkWeSScKHOsTMH5QUe/bsDhbyqC0EwtsAp7XJ+O1XxkAgL0jCikIKFWXmk 2Vbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=yJiS9C5fDDbD91wazdMZk/z04HM1Pe9z5nwu5g3IHxo=; b=J70KN3w+4vxNRZrOLdEf9cli6v727iT3lgUgpgCzWpcyLiwlbBA3cNhcH/AWeR/dfR tWrp1I4djuRWSxFTcZ8RSblLqocJI8oEvCLF8EUqVBX2CvvSKJVskUKors8N6GkZLYAG oV6ATSPiGm/bmpcquDLpyA1t1mndunsC7pnjkP/KbHaXU1I01nHQklYeFWDTVxjOuUUg BcYy+9VxbpRWaaI94p6N6QYcB7vWHbphvetFvY/qneQu9Q30iA2+V0cSbtrcqkRrZrBM kleAYOK8yLIrRsM8ig6d6AAmxeL17VXt0mAzadO8E6JSHDsjLLGse2zf+c/vqTVfRrjT WrlA== X-Gm-Message-State: ALQs6tDJjq3bMFLQ+LF10zjzQ5c5EUnsGcMEr66n6fdHHT/42CG9ffkb 1idua47zfsCJeKavRVcR9o5EDw== X-Google-Smtp-Source: AB8JxZpNYunGZ4cP1glA/+Dp63mZ5rEhtRblcaypq/KtSoz7ktZz54qJLpEz7o3Q12M3C3ktIKhfdw== X-Received: by 2002:ac8:376b:: with SMTP id p40-v6mr26934744qtb.282.1524533243942; Mon, 23 Apr 2018 18:27:23 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 23 Apr 2018 22:26:21 -0300 Message-Id: <20180424012621.2518-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 24 Apr 2018 01:27:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 24 Apr 2018 01:27:25 +0000 (UTC) for IP:'209.85.216.196' DOMAIN:'mail-qt0-f196.google.com' HELO:'mail-qt0-f196.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.216.196 mail-qt0-f196.google.com 209.85.216.196 mail-qt0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3] qemu: avoid slash characters to the new domain name. 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-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.27]); Tue, 24 Apr 2018 01:28:36 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'domrename' command needs to check if the new domain name contains the slash character. This character is not accepted by libvirt XML definition because it is an invalid char (see Cole's commit b1fc6a7b7). This commit enhace the 'domrename' command adding this check. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1333232 Signed-off-by: Julio Faracco Reviewed-by: John Ferlan --- src/qemu/qemu_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7484b00e2..70ae18524 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20757,6 +20757,12 @@ qemuDomainRenameCallback(virDomainObjPtr vm, if (VIR_STRDUP(new_dom_name, new_name) < 0) goto cleanup; =20 + if (strchr(new_dom_name, '/')) { + virReportError(VIR_ERR_XML_ERROR, + _("name %s cannot contain '/'"), new_dom_name); + goto cleanup; + } + if (!(new_dom_cfg_file =3D virDomainConfigFile(cfg->configDir, new_dom_name)) || !(old_dom_cfg_file =3D virDomainConfigFile(cfg->configDir, --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list