From nobody Tue Feb 10 00:43:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610613528; cv=none; d=zohomail.com; s=zohoarc; b=MZjjjq4azp33yAnEsyhnvb1gxZJR7vjz664GX8W4dmjHeFrW+hJJ47UbJZifI/g0DJK4pu0rc0yZHqg6obs9r1tOduBcN+Bd5wwNEY1drufk+B6Fh5wUKg3bFJpGams022+8qO+AdEM0ZygoCsdWV2UbX61xRCuOB/TNCLDEIiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610613528; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oyVKnQ9b5uYTF+PfHi5SgyvajvcMBuMqED/16qSLt+w=; b=HXUWdBGeBt6dkvgNcHLtHbExxOl5reKYrE7TtuGBcEHxJsBu2bl4eTcZXp7hbEF1hjyrYxmmmSUNFAlK0LYUF7lL7sDFPSc3GTZxKVZ4VuXu9cafN8gu4hdt8dMh7YUuGMU+dHz9zkCA/93ddjrlY8zC+Zkem1EUpvmpqLQYb4o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610613528812412.577032083679; Thu, 14 Jan 2021 00:38:48 -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-453-7IAVNWBiNMGGC-g6cBNyUw-1; Thu, 14 Jan 2021 03:38:45 -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 78CCD8712EC; Thu, 14 Jan 2021 08:38:37 +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 E4F5E5C67A; Thu, 14 Jan 2021 08:38:36 +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 2D767180954D; Thu, 14 Jan 2021 08:38:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10E8cVhO022206 for ; Thu, 14 Jan 2021 03:38:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 05F00102044A; Thu, 14 Jan 2021 08:38:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0210410F8E34 for ; Thu, 14 Jan 2021 08:38:28 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E0B4803DDF for ; Thu, 14 Jan 2021 08:38:28 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-XYT_KVyAPx-ERY8XJLh9MA-1; Thu, 14 Jan 2021 03:38:25 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DGccs2lJfz15sgK for ; Thu, 14 Jan 2021 16:17:49 +0800 (CST) Received: from DESKTOP-F1615D3.china.huawei.com (10.174.186.85) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Thu, 14 Jan 2021 16:18:44 +0800 X-MC-Unique: 7IAVNWBiNMGGC-g6cBNyUw-1 X-MC-Unique: XYT_KVyAPx-ERY8XJLh9MA-1 From: Zihao Chang To: Subject: [PATCH 5/6] authz: support passing sasl acl in vnc to qemu cmd Date: Thu, 14 Jan 2021 16:18:20 +0800 Message-ID: <20210114081821.146-6-changzihao1@huawei.com> In-Reply-To: <20210114081821.146-1-changzihao1@huawei.com> References: <20210114081821.146-1-changzihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.186.85] X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 10E8cVhO022206 X-loop: libvir-list@redhat.com Cc: oscar.zhangbo@huawei.com, changzihao1@huawei.com, xiexiangyou@huawei.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 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" support passing sasl acl in vnc to qemu cmd. turn the xml example: ... ... into qemu cmd: qemu-kvm ... -vnc 0.0.0.0:0,sasl,sasl-authz=3Dauthz1 Signed-off-by: Zihao Chang --- src/qemu/qemu_command.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8679c62d550f..e1a07a6e7113 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7537,6 +7537,30 @@ qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfigP= tr cfg G_GNUC_UNUSED, } =20 =20 +static int +qemuBuildGraphicsVNCAuthzCommandLine(virBufferPtr opt, + virDomainGraphicsDefPtr graphics) +{ + size_t i; + int nAuthzs =3D graphics->data.vnc.auth.nAuthzs; + virDomainGraphicsAuthzDefPtr authzs =3D graphics->data.vnc.auth.authzs; + + if (nAuthzs <=3D 0) { + return 0; + } + + for (i =3D 0; i < nAuthzs; i++) { + if (authzs[i].type =3D=3D VIR_DOMAIN_AUTHZ_TYPE_SASL) { + virBufferAsprintf(opt, ",sasl-authz=3Dauthz%lu", authzs[i].ind= ex); + } else if (authzs[i].type =3D=3D VIR_DOMAIN_AUTHZ_TYPE_TLS) { + virBufferAsprintf(opt, ",tls-authz=3Dauthz%lu", authzs[i].inde= x); + } + } + + return 0; +} + + static int qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, virCommandPtr cmd, @@ -7643,7 +7667,10 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigP= tr cfg, if (cfg->vncSASLdir) virCommandAddEnvPair(cmd, "SASL_CONF_PATH", cfg->vncSASLdir); =20 - /* TODO: Support ACLs later */ + } + + if (cfg->vncSASL || cfg->vncTLS) { + qemuBuildGraphicsVNCAuthzCommandLine(&opt, graphics); } =20 virCommandAddArg(cmd, "-vnc"); --=20 2.28.0