1. 10 2月, 2012 1 次提交
    • G
      vnc: implement shared flag handling. · 8cf36489
      Gerd Hoffmann 提交于
      VNC clients send a shared flag in the client init message.  Up to now
      qemu completely ignores this.  This patch implements shared flag
      handling.  It comes with three policies:  By default qemu behaves as one
      would expect:  Asking for a exclusive access grants exclusive access to
      the client connecting.  There is also a desktop sharing mode which
      disallows exclusive connects (so one forgetting -shared wouldn't drop
      everybody else) and a compatibility mode which mimics the traditional
      (but non-conforming) qemu behavior.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8cf36489
  2. 24 7月, 2011 1 次提交
    • D
      Store VNC auth scheme per-client as well as per-server · 7e7e2ebc
      Daniel P. Berrange 提交于
      A future patch will introduce a situation where different
      clients may have different authentication schemes set.
      When a new client arrives, copy the 'auth' and 'subauth'
      fields from VncDisplay into the client's VncState, and
      use the latter in all authentication functions.
      
      * ui/vnc.h: Add 'auth' and 'subauth' to VncState
      * ui/vnc-auth-sasl.c, ui/vnc-auth-vencrypt.c,
        ui/vnc.c: Make auth functions pull auth scheme
        from VncState instead of VncDisplay
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      7e7e2ebc
  3. 11 3月, 2011 1 次提交
    • S
      vnc: Fix stack corruption and other bitmap related bugs · 23bfe28f
      Stefan Weil 提交于
      Commit bc2429b9 introduced
      a severe bug (stack corruption).
      
      bitmap_clear was called with a wrong argument
      which caused out-of-bound writes to the local variable width_mask.
      
      This bug was detected with QEMU running on windows.
      It also occurs with wine:
      
      *** stack smashing detected ***:  terminated
      wine: Unhandled illegal instruction at address 0x6115c7 (thread 0009), starting debugger...
      
      The bug is not windows specific!
      
      Instead of fixing the wrong parameter value, bitmap_clear(), bitmap_set
      and width_mask were removed, and bitmap_intersect() was replaced by
      !bitmap_empty(). The new operation is much shorter and equivalent to
      the old operations.
      
      The declarations of the dirty bitmaps in vnc.h were also wrong for 64 bit
      hosts because of a rounding effect: for these hosts, VNC_MAX_WIDTH is no
      longer a multiple of (16 * BITS_PER_LONG), so the rounded value of
      VNC_DIRTY_WORDS was too small.
      
      Fix both declarations by using the macro which is designed for this
      purpose.
      
      Cc: Corentin Chary <corentincj@iksaif.net>
      Cc: Wen Congyang <wency@cn.fujitsu.com>
      Cc: Gerhard Wiesinger <lists@wiesinger.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NStefan Weil <weil@mail.berlios.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      23bfe28f
  4. 24 2月, 2011 5 次提交
  5. 09 12月, 2010 1 次提交
  6. 27 7月, 2010 6 次提交
  7. 02 6月, 2010 8 次提交
  8. 25 5月, 2010 1 次提交
  9. 04 5月, 2010 1 次提交
  10. 10 4月, 2010 1 次提交
  11. 20 3月, 2010 1 次提交
  12. 18 3月, 2010 1 次提交
  13. 09 3月, 2010 1 次提交
    • G
      kbd keds: vnc · 7ffb82ca
      Gerd Hoffmann 提交于
      Use led status notification support in vnc.
      
      The qemu vnc server keeps track of the capslock and numlock states based
      on the key presses it receives from the vnc client.  But this fails in
      case the guests idea of the capslock and numlock state changes for other
      reasons.  One case is guest reboot (+ keyboard reset).  Another case are
      more recent windows versions which reset capslock state before
      presenting the login screen.
      
      Usually guests use the keyboard leds to signal the capslock and numlock
      state to the user, so we can use this to better keep track of capslock
      and numlock state in the qemu vnc server.
      
      Also toggle the numlock and capslock states on keydown events (instead
      of keyup).  Guests do the same.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      7ffb82ca
  14. 11 2月, 2010 2 次提交
  15. 20 1月, 2010 1 次提交
    • L
      VNC: Cache client info at connection time · 4a80dba3
      Luiz Capitulino 提交于
      When a disconnection happens the client's socket on QEMU
      side may become invalid, this way it won't be possible
      to query it to get client information, which is going to
      be needed by the future QMP VNC_DISCONNECTED event.
      
      To always have this information available we query the
      socket at connection time and cache the client info in
      struct VncState.
      
      Two function are introduced to perform this job.
      
      vnc_client_cache_addr() is called right when the connection
      is made, however the authentication information is not
      available at that moment so vnc_client_cache_auth() is
      called from protocol_client_init() to get auth info.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      4a80dba3
  16. 02 10月, 2009 2 次提交
  17. 11 8月, 2009 3 次提交
  18. 20 3月, 2009 2 次提交
    • A
      vnc: throttle screen updates. (Gerd Hoffmann) · c522d0e2
      aliguori 提交于
      This patch makes the vnc server code skip screen refreshes in case
      there is data in the output buffer.  This reduces the refresh rate to
      throttle the bandwidth needed in case the network link is saturated.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6862 c046a42c-6fe2-441c-8c8c-71466251a162
      c522d0e2
    • A
      vnc: cleanup surface handling, fix screen corruption bug. (Gerd Hoffmann) · 6baebed7
      aliguori 提交于
      This patch killes the old_data hack in the qemu server and replaces
      it with a clean separation of the guest-visible display surface and
      the vnc server display surface.  Both guest and server surface have
      their own dirty bitmap for tracking screen updates.
      
      Workflow is this:
      
      (1) The guest writes to the guest surface.  With shared buffers being
          active the guest writes are directly visible to the vnc server code.
          Note that this may happen in parallel to the vnc server code running
          (today only in xenfb, once we have vcpu threads in qemu also for
          other display adapters).
      
      (2) vnc_update() callback tags the specified area in the guest dirty
          map.
      
      (3) vnc_update_client() will first walk through the guest dirty map.  It
          will compare guest and server surface for all regions tagged dirty
          and in case the screen content really did change the server surface
          and dirty map are updated.
          Note: old code used old_data in a simliar way, so this does *not*
          introduce an extra memcpy.
      
      (4) Then vnc_update_cient() will send the updates to the vnc client
          using the server surface and dirty map.
          Note: old code used the guest-visible surface instead, causing
          screen corruption in case of guest screen updates running in
          parallel.
      
      The separate dirty bitmap also has the nice effect that forced screen
      updates can be done cleanly by simply tagging the area in both guest and
      server dirty map.  The old, hackish way was memset(old_data, 42, size)
      to trick the code checking for screen changes.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6860 c046a42c-6fe2-441c-8c8c-71466251a162
      6baebed7
  19. 07 3月, 2009 1 次提交
    • A
      Support ACLs for controlling VNC access ("Daniel P. Berrange") · 76655d6d
      aliguori 提交于
      This patch introduces a generic internal API for access control lists
      to be used by network servers in QEMU. It adds support for checking
      these ACL in the VNC server, in two places. The first ACL is for the
      SASL authentication mechanism, checking the SASL username. This ACL
      is called 'vnc.username'. The second is for the TLS authentication
      mechanism, when x509 client certificates are turned on, checking against
      the Distinguished Name of the client. This ACL is called 'vnc.x509dname'
      
      The internal API provides for an ACL with the following characteristics
      
       - A unique name, eg  vnc.username, and vnc.x509dname.
       - A default policy, allow or deny
       - An ordered series of match rules, with allow or deny policy
      
      If none of the match rules apply, then the default policy is
      used.
      
      There is a monitor API to manipulate the ACLs, which I'll describe via
      examples
      
        (qemu) acl show vnc.username
        policy: allow
        (qemu) acl policy vnc.username denya
        acl: policy set to 'deny'
        (qemu) acl allow vnc.username fred
        acl: added rule at position 1
        (qemu) acl allow vnc.username bob
        acl: added rule at position 2
        (qemu) acl allow vnc.username joe 1
        acl: added rule at position 1
        (qemu) acl show vnc.username
        policy: deny
        0: allow fred
        1: allow joe
        2: allow bob
      
      
        (qemu) acl show vnc.x509dname
        policy: allow
        (qemu) acl policy vnc.x509dname deny
        acl: policy set to 'deny'
        (qemu) acl allow vnc.x509dname C=GB,O=ACME,L=London,CN=*
        acl: added rule at position 1
        (qemu) acl allow vnc.x509dname C=GB,O=ACME,L=Boston,CN=bob
        acl: added rule at position 2
        (qemu) acl show vnc.x509dname
        policy: deny
        0: allow C=GB,O=ACME,L=London,CN=*
        1: allow C=GB,O=ACME,L=Boston,CN=bob
      
      By default the VNC server will not use any ACLs, allowing access to
      the server if the user successfully authenticates. To enable use of
      ACLs to restrict user access, the ',acl' flag should be given when
      starting QEMU. The initial ACL activated will be a 'deny all' policy
      and should be customized using monitor commands.
      
      eg enable SASL auth and ACLs
      
          qemu ....  -vnc localhost:1,sasl,acl
      
      The next patch will provide a way to load a pre-defined ACL when
      starting up
      
      
       Makefile        |    6 +
       b/acl.c         |  185 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       b/acl.h         |   74 ++++++++++++++++++++++
       configure       |   18 +++++
       monitor.c       |   95 ++++++++++++++++++++++++++++
       qemu-doc.texi   |   49 ++++++++++++++
       vnc-auth-sasl.c |   16 +++-
       vnc-auth-sasl.h |    7 ++
       vnc-tls.c       |   19 +++++
       vnc-tls.h       |    3 
       vnc.c           |   21 ++++++
       vnc.h           |    3 
       12 files changed, 491 insertions(+), 5 deletions(-)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6726 c046a42c-6fe2-441c-8c8c-71466251a162
      76655d6d