When a transient namespace is deleted, XnsDestroyNamespace() frees the
namespace struct, its name, and its authentication tokens. However, it
leaves the virtual root window active in the server's resource database.
Because the virtual root window is never freed, the server leaks a Window
structure, window attributes, and properties every time a temporary
namespace is destroyed.
Fix this leak by calling FreeResource() on the virtual root window
before destroying the namespace.
Also update the formal TLA+ model in doc/Xnamespace.tla to track
resource cleanup and verify the fix.
Signed-off-by: Mason Green <mason@greenm01.net>
When the configuration file is parsed at server startup, select_ns()
dynamically allocates namespace structures. However, it does not check
whether calloc() or strdup() successfully allocate memory.
If calloc() fails, the server dereferences a NULL pointer and crashes
instantly.
If strdup() fails, the namespace is added to the global list with a
NULL name. When the server later searches for a namespace, it calls
strlen() on the NULL name. This causes a delayed crash of the server
at runtime.
Fix this by adding standard FatalError() checks to handle allocation
failures safely during startup.
Also include a formal TLA+ verification model of the Xnamespace
security isolation extension in doc/Xnamespace.tla.
Signed-off-by: Mason Green <mason@greenm01.net>
CreateNamespace's field comment and the §8 required-changes list still
named the pre-implementation identifiers XnsAttrAutoRemove/XnsAttrBuiltin;
the actual wire constants are XNS_ATTR_TRANSIENT/XNS_ATTR_IMMUTABLE. Also
clean up the garbled §8 item 4 sentence.
Flagged as an advisory (non-blocking) note in the bot review.
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@vnc.biz>
Add a superPower-only X11 extension (X-NAMESPACE) for managing namespaces
at runtime, the settings that were previously only provisionable from the
namespace.conf file at startup.
Requests: QueryVersion, {List,Create,Delete,Query}Namespace,
SetNamespaceFlags, {Add,Remove,List}AuthToken and GetClientNamespace.
Names are the wire identifier; capabilities/attributes are bitmasks.
Transient namespaces auto-remove when their last client exits.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2134>
----------------------------------------------------------------------------
This commit is the result of `git apply commit.diff --reject`
applied on e8f452231267c82078fe does not
apply to Xlibre
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Not used by any external drivers, so no need to keep it in public SDK.
Since it's used by internal modules, still needs to be _X_EXPORT'ed.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Nobody's using this pointer anymore, everybody's using the global
screenInfo structure.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This reverts commit b1ff69a654.
broke the docs build ... and it also seems certain pieces got even missing.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used by any external drivers, so no need to keep it exported.
Also renamed to dixClientSignal(), since there's a conflicting prototype
in fontsproto.h.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Only used at exactly one place, for trivial size computation, so not worth
having an extra macro in a public header for this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1805>
Direct calls to ScreenRec->DestroyPixmap() is fragile and blocks cleaning up
the wrapping jungle, so use the proper dix function instead.
While this function originally wasn't made for that purpose (and so we have an
useless parameter here, and the naming isn't entirely correct), it's the best
effort we have right now, without breaking existing API: it's already exported
since long time, so drivers can be easily converted and still work with both
new and older Xserver ABI versions.
Retrospectively, this already should have been done 20 years ago.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
These aren't used by any drivers/modules, so no need to keep them exported.
As already touching them, give them a proper name prefix for clarity.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1581>
Windows' native headers using some our RT_* define's names for other things.
Since the naming isn't very nice anyways, introducing some new ones
(X11_RESTYPE_NONE, X11_RESTYPE_FONT, X11_RESTYPE_CURSOR) and define the old
ones as an alias to them, in case some out-of-tree code still uses them.
With thins change, we don't need to be so extremely careful about include
ordering and have explicit #undef's in order to prevent name clashes on
Win32 targets.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
The workQueue pointer is currently declared extern, so that WaitForSomething()
can check wether we've got something in the queue and call ProcessWorkQueue()
then.
But that's trivial to simplify: just let ProcessWorkQueue() return early if
workQueue == NULL. Gives us a better isolation of internal stuff as well as
ProcessWorkQueue() protecting itself from possible segfault.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1310>
Most (but not all) of these were found by using
codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Slightly simplifies the callers since they don't need to check for
non-NULL anymore.
I do extremely hate the workarounds here to suppress misprite taking the
cursor down though. Surely there's a better way.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Add an option to turn on the use of the X window's alpha channel in
multiwindow mode, i.e. this uses the X window's alpha channel for
compositing into the native desktop.
This works on W7/Vista (using DwmEnableBlurBehindWindow()), and Windows
10 (using the undocumented SetWindowCompositionAttribute()), but not on
Windows 8/8.1
-compositewm must be enabled for this to be useful, as we only have a
pixmap with an alpha channel for the X window in that case. The
framebuffer/root window doesn't have one (unless perhaps you are using
the rootless extension, maybe...).
v2:
Update meson.build
Future work:
A window property to control use of alpha?
Option to turn off blur on W7/Vista
Implement _NET_WM_WINDOW_OPACITY
This hasn't done anything besides return TRUE in a long long time.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
These are so close to identical that most DDXes implement one in terms
of the other. All the relevant cases can be distinguished by the error
code, so merge the functions together to make things simpler.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
The clever pointer tricks were actually not working, and we were doing
the byte-by-byte moves in general. By just doing the memcpy and
obvious byte swap code, we end up generating actual byte swap
instructions, thanks to optimizing compilers.
text data bss dec hex filename
before: 2240807 51552 132016 2424375 24fe37 hw/xfree86/Xorg
after: 2215167 51552 132016 2398735 249a0f hw/xfree86/Xorg
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
With no users of the interface needing the readmask anymore, we can
remove it from the argument passed to these functions.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
It looks like it serves no special purpose.
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Functions were removed in commit cad9b053d5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This reduces the build log spam while still preserving the xmlto
status to catch build failures correctly.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Update what c-extensions says about Windows platforms support a bit:
- Document that MinGW Win32 gets let off being POSIX-compilant
- Document the minimum Windows version supported
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>