Commit Graph

22 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 3790155593 Xnamespace: add support for multiple auth tokens per namespace
Support having more than one auth token per namespace, so separate tokens
can be handed out to clients that are still landing in the same namespace.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 60b9d0daa0 Xnamespace: initial config loader
This loads the configuration (simple text file) passed via command line.
For now just supporting static configuration, that's loaded on server
startup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 0d755636c6 Xnamespace: property access hook
Filter property access. Right now just allowed inside same namespace,
or when caller is in root namespace.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 56aff8b09b Xnamespace: whitelist access to some server resources
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 240e21ccdd Xnamespace: whitelist some XI operations
Whitelisting some XI operations in various hooks.

Note that some additional filtering needs to be done in send or
receive hook in order to prevent clients to receive possibly sensible
input data from the root window.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 2d3a774902 Xnamespace: filter access on other clients
Restrict access to other clients within same namespace.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 102d6a47b7 Xnamespace: filter client-to-client message sending
Filter message sending by clients. Only sending within the same
namespace is allowed (except for clients in a NS with superpowers,
e.g. root)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 22c68e50ec Xnamespace: filter server access
Whitelisting several server access calls that are safe, rejecting the rest.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 421962eeb3 Xnamespace: filter device access
Filter device access, whitelist several commonly used operations that
should be safe (eg. query keyboard layout).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 5d064423c9 Xnamespace: whitelist access to namespace virtual root window
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 817f107dfe Xnamespace: whitelist certain operations on (real) root window
CreateWindow() needs access to root window, in order to create
top level windows. Whitelisting this operation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult f3407ab1ae Xnamespace: whitelist resource access for serverClient
The server itself is allowed to access anything w/o restrictions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult b828d3763c Xnamespace: whitelist resource access within same namespace
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 9e9f75f7f8 Xnamespace: filter transparency
Silently drop transparency flag if namespace isn't allowed to use it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult f5eb98b088 Xnamespace: filter extension access
Whitelist several extension calls that are safe. Also allow namespaces
to be configured for unrestricted access.

TBD: doesn't actually reject yet

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult c1f5aa54b4 Xnamespace: filter raw mouse motion and keyboard access
Only namespaces with allowMouseOption flag enabled can receive
raw mouse motion events. Raw key press events are always blocked.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 9b962e0645 Xnamespace: isolate root window property access
Redirecting access to root window properties to the per-namespace
virtual root windows. This isolates a lot of communication via root
window, e.g. the cut buffers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 3022f4aca9 Xnamespace: create per-namespace fake root windows
For each namespace creating a fake (invisible) root window, which can be
used for storing per-namespace properties (eg. cut buffers), etc.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 25533d872d Xnamespace: add selection isolation
Selection names (as seen by the client) are internally prefixed with the
namespace ID, so each client can only access those within it's namespace.

If a client within namespace "foo" want's to operate on "PRIMARY",
it actually will be doing so on "<foo>PRIMARY", w/o ever noticing it.
Events will sent back to the client still pointing to "PRIMARY".

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 96b6421862 Xnamespace: assign incoming clients to namespaces
The association is done by matching client's and namespace's
authentication token.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult ab423f3f19 Xnamespace: add basic namespace config structures
Adding data structure and initial data for namespace configuration.

Built-in namespaces are ROOT and ANONYMOUS.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00
Enrico Weigelt, metux IT consult 9b19a75a7b Xnamespace: namespace extension skeleton
Add tiny skeleton for the namespace extension. Disabled by default,
can be enabled via +extension arg, but doesn't actually do something yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-04 18:51:26 +02:00