1. 07 May, 2020 1 commit
  2. 05 Jan, 2020 1 commit
  3. 27 Feb, 2018 1 commit
  4. 21 Mar, 2017 3 commits
  5. 20 Mar, 2017 1 commit
    • Aaron Plattner's avatar
      os: Return BadLength instead of disconnecting BigReq clients (#4565) · 2ecd2a00
      Aaron Plattner authored
       Backported from X.org:
      
       commit 67c66606c760c263d7a4c2d1bba43ed6225a4e7c
       Author: Robert Morell <rmorell@nvidia.com>
       Date:   Thu May 9 13:09:02 2013 -0700
      
          os: Reset input buffer's 'ignoreBytes' field
      
          If a client sends a request larger than maxBigRequestSize, the server is
          supposed to ignore it.
      
          Before commit cf88363d, the server would simply disconnect the client.  After
          that commit, it attempts to gracefully ignore the request by remembering how
          long the client specified the request to be, and ignoring that many bytes.
          However, if a client sends a BigReq header with a large size and disconnects
          before actually sending the rest of the specified request, the server will
          reuse the ConnectionInput buffer without resetting the ignoreBytes field.  This
          makes the server ignore new X clients' requests.
      
          This fixes that behavior by resetting the ignoreBytes field when putting the
          ConnectionInput buffer back on the FreeInputs list.
      Signed-off-by: 's avatarRobert Morell <rmorell@nvidia.com>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      
       commit c80c41767eb101e9dbd8393d8cca7764b4e248a4
       Author: Aaron Plattner <aplattner@nvidia.com>
       Date:   Mon Oct 25 22:01:32 2010 -0700
      
          os: Fix BigReq ignoring when another request is pending
      
          Commit cf88363db0ebb42df7cc286b85d30d7898aea840 fixed the handling of
          BigReq requests that are way too large and handles the case where the
          read() syscall returns a short read.  However, it neglected to handle
          the case where it returns a long read, which happens when the client
          has another request in the queue after the bogus large one.
      
          Handle the long read case by subtracting the smaller of 'needed' and
          'gotnow' from oci->ignoreBytes.  If needed < gotnow, simply subtract
          the two, leaving gotnow equal to the number of extra bytes read.
          Since the code immediately following the (oci->ignoreBytes > 0) block
          tries to handle the next request, advance oci->bufptr immediately
          instead of setting oci->lenLastReq and letting the next call to
          ReadRequestFromClient do it.
      
          Fixes the XTS pChangeKeyboardMapping-3 test.
      
                   CASES TESTS  PASS UNSUP UNTST NOTIU  WARN   FIP  FAIL UNRES  UNIN ABORT
          -Xproto    122   389   367     2    19     0     0     0     1     0     0     0
          +Xproto    122   389   368     2    19     0     0     0     0     0     0     0
      Signed-off-by: 's avatarAaron Plattner <aplattner@nvidia.com>
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      
       commit cf88363db0ebb42df7cc286b85d30d7898aea840
       Author: Aaron Plattner <aplattner@nvidia.com>
       Date:   Fri Aug 27 10:20:29 2010 -0700
      
          os: Return BadLength instead of disconnecting BigReq clients (#4565)
      
          If a client sends a big request that's too big (i.e. bigger than
          maxBigRequestSize << 2 bytes), the server just disconnects it.  This makes the
          client receive SIGPIPE the next time it tries to send something.
      
          The X Test Suite sends requests that are too big when the test specifies the
          TOO_LONG test type.  When the client receives SIGPIPE, XTS marks it as
          UNRESOLVED, which counts as a failure.
      
          Instead, remember how long the request is supposed to be and then return that
          size.  Dispatch() checks the length and sends BadLength to the client.  Then,
          whenever oci->ignoreBytes is nonzero, ignore the data read instead of trying to
          process it as a request.
      Signed-off-by: 's avatarAaron Plattner <aplattner@nvidia.com>
      Reviewed-by: 's avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
      2ecd2a00
  6. 17 Mar, 2017 1 commit
  7. 15 Mar, 2017 1 commit
    • Keith Packard's avatar
      os: Add NotifyFd interfaces · 86110d6e
      Keith Packard authored
       Backported from X.org:
      
       commit 0c41b7af4ab0c8d22b88f201293f59524d1e7317
       Author: Keith Packard <keithp@keithp.com>
       Date:   Wed Nov 11 22:02:02 2015 -0800
      
          os: Add NotifyFd interfaces
      
          This provides a callback-based interface to monitor file
          descriptors beyond the usual client and device interfaces.
      
          Modules within the server using file descriptors for reading and/or
          writing can call
      
              Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data);
      
          mask can be any combination of X_NOTIFY_READ and X_NOTIFY_WRITE.
      
          When 'fd' becomes readable or writable, the notify_fd function will be
          called with the 'fd', the ready conditions and 'data' values as arguments,
      
          When the module no longer needs to monitor the fd, it will call
      
              void RemoveNotifyFd(int fd);
      
          RemoveNotifyFd may be called from the notify function.
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
      86110d6e
  8. 01 Mar, 2017 4 commits
  9. 08 Feb, 2017 4 commits
  10. 05 Jul, 2016 2 commits
  11. 01 Jul, 2016 1 commit
  12. 01 Jun, 2016 1 commit
  13. 28 Dec, 2015 2 commits
    • Mike Gabriel's avatar
      Clear header file namespace separation (<X11/...> vs. <nx-X11/...>). · 433d8186
      Mike Gabriel authored
       In the process of building nxagent against more and more system-wide installed
       X.org libraries, we come to the limit of including structs from this (bundled
       nx-X11) and that (system-wide X.Org) library.
      
       This commit introduces a clear namespace separation of headers provided by
       nx-X11 and headers provided by X.Org. This approach is only temporary as we
       want to drop all nx-X11 bundled libraries from nx-libs.
      
       However, for a while we need to make this separation clear and also ship
       some reduced fake X.Org headers that avoid pulling in libX* and libNX_X*
       symbols at the same time.
      
       This patch has been tested on Debian jessie and unstable and requires no
       overall testing on various distros and distro versions, as we finally will
       drop all libNX_X* libraries and build against X.org's client libs.
      
       For now, this hack eases our development / cleanup process.
      433d8186
    • Keith Packard's avatar
      Replace 'pointer' type with 'void *' · 68dd0b52
      Keith Packard authored
       This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
       is used throughout the X server for other things, and having duplicate
       names generates compiler warnings.
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: 's avatarEric Anholt <eric@anholt.net>
       Rebased against NX: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
      68dd0b52
  14. 10 Oct, 2011 1 commit