All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 03/10] vnc: add display id to acl names
Date: Thu, 22 Jan 2015 12:04:01 +0100	[thread overview]
Message-ID: <1421924648-21963-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1421924648-21963-1-git-send-email-kraxel@redhat.com>

In case the display id is "default" (which is the one you get if you
don't explicitly assign one) we keep the old name scheme, without
display, for backward compatibility reasons.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
---
 ui/vnc.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index d988275..24b5540 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3207,18 +3207,36 @@ void vnc_display_open(const char *id, const char *display, Error **errp)
 
 #ifdef CONFIG_VNC_TLS
     if (acl && x509 && vs->tls.x509verify) {
-        if (!(vs->tls.acl = qemu_acl_init("vnc.x509dname"))) {
+        char *aclname;
+
+        if (strcmp(vs->id, "default") == 0) {
+            aclname = g_strdup("vnc.x509dname");
+        } else {
+            aclname = g_strdup_printf("vnc.%s.x509dname", vs->id);
+        }
+        vs->tls.acl = qemu_acl_init(aclname);
+        if (!vs->tls.acl) {
             fprintf(stderr, "Failed to create x509 dname ACL\n");
             exit(1);
         }
+        g_free(aclname);
     }
 #endif
 #ifdef CONFIG_VNC_SASL
     if (acl && sasl) {
-        if (!(vs->sasl.acl = qemu_acl_init("vnc.username"))) {
+        char *aclname;
+
+        if (strcmp(vs->id, "default") == 0) {
+            aclname = g_strdup("vnc.username");
+        } else {
+            aclname = g_strdup_printf("vnc.%s.username", vs->id);
+        }
+        vs->sasl.acl = qemu_acl_init(aclname);
+        if (!vs->sasl.acl) {
             fprintf(stderr, "Failed to create username ACL\n");
             exit(1);
         }
+        g_free(aclname);
     }
 #endif
 
-- 
1.8.3.1

  parent reply	other threads:[~2015-01-22 11:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 11:03 [Qemu-devel] [PULL 00/10] vnc: add support for multiple vnc displays Gerd Hoffmann
2015-01-22 11:03 ` [Qemu-devel] [PULL 01/10] vnc: remove vnc_display global Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 02/10] vnc: remove unused DisplayState parameter, add id instead Gerd Hoffmann
2015-01-22 11:04 ` Gerd Hoffmann [this message]
2015-01-22 11:04 ` [Qemu-devel] [PULL 04/10] vnc: switch to QemuOpts, allow multiple servers Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 05/10] vnc: allow binding servers to qemu consoles Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 06/10] vnc: update docs/multiseat.txt Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 07/10] vnc: track & limit connections Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 08/10] vnc: factor out qmp_query_client_list Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 09/10] monitor: add query-vnc-servers command Gerd Hoffmann
2015-01-22 11:04 ` [Qemu-devel] [PULL 10/10] monitor: add vnc websockets Gerd Hoffmann
2015-01-22 13:55 ` [Qemu-devel] [PULL 00/10] vnc: add support for multiple vnc displays Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2014-12-19  9:04 Gerd Hoffmann
2014-12-19  9:04 ` [Qemu-devel] [PULL 03/10] vnc: add display id to acl names Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421924648-21963-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.