Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dix/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Equipment Corporation.
#include "dix/screensaver_priv.h"
#include "dix/selection_priv.h"
#include "dix/server_priv.h"
#include "dix/settings_priv.h"
#include "dix/window_priv.h"
#include "include/resource.h"
#include "miext/extinit_priv.h"
Expand Down Expand Up @@ -3907,7 +3908,7 @@ ProcEstablishConnection(ClientPtr client)

prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq);

if (client->swapped && !AllowByteSwappedClients) {
if (client->swapped && !dixSettingAllowByteSwappedClients) {
reason = "Prohibited client endianess, see the Xserver man page ";
} else if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix +
pad_to_int32(prefix->nbytesAuthProto) +
Expand Down
1 change: 1 addition & 0 deletions dix/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ SOFTWARE.

#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "dix/settings_priv.h"

#include "misc.h"
#include "windowstr.h"
Expand Down
1 change: 1 addition & 0 deletions dix/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ srcs_dix = [
'screen_hooks.c',
'selection.c',
'screen.c',
'settings.c',
'swaprep.c',
'swapreq.c',
'tables.c',
Expand Down
17 changes: 17 additions & 0 deletions dix/settings.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*
* This file holds global DIX *settings*, which might be needed by other
* parts, e.g. OS layer or DDX'es.
*
* Some of them might be influenced by command line args, some by xf86's
* config files.
*/
#include <dix-config.h>

#include <stdbool.h>

#include "dix/settings_priv.h"

bool dixSettingAllowByteSwappedClients = false;
19 changes: 19 additions & 0 deletions dix/settings_priv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DIX_SETTINGS_H
#define _XSERVER_DIX_SETTINGS_H

#include <stdbool.h>

/* This file holds global DIX *settings*, which might be needed by other
* parts, e.g. OS layer or DDX'es.
*
* Some of them might be influenced by command line args, some by xf86's
* config files.
*/

extern bool dixSettingAllowByteSwappedClients;

#endif
8 changes: 6 additions & 2 deletions hw/xfree86/common/xf86Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <grp.h>

#include "dix/resource_priv.h"
#include "dix/settings_priv.h"
#include "dix/screensaver_priv.h"
#include "include/extinit.h"
#include "os/log_priv.h"
Expand Down Expand Up @@ -752,8 +753,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
LogMessageVerb(X_CONFIG, 1, "Ignoring ABI Version\n");
}

xf86GetOptValBool(FlagOptions, FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, &AllowByteSwappedClients);
if (AllowByteSwappedClients) {
Bool bv = FALSE;
if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, &bv)) {
dixSettingAllowByteSwappedClients = bv;
}
if (dixSettingAllowByteSwappedClients) {
LogMessageVerb(X_CONFIG, 1, "Allowing byte-swapped clients\n");
}

Expand Down
1 change: 0 additions & 1 deletion os/osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ extern Bool PartialNetwork;

extern Bool CoreDump;
extern Bool NoListenAll;
extern Bool AllowByteSwappedClients;

/*
* This function reallocarray(3)s passed buffer, terminating the server if
Expand Down
7 changes: 3 additions & 4 deletions os/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ OR PERFORMANCE OF THIS SOFTWARE.

#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "dix/settings_priv.h"
#include "dix/screensaver_priv.h"
#include "miext/extinit_priv.h"
#include "os/audit_priv.h"
Expand Down Expand Up @@ -127,8 +128,6 @@ Bool CoreDump;

Bool enableIndirectGLX = FALSE;

Bool AllowByteSwappedClients = FALSE;

#ifdef XINERAMA
Bool PanoramiXExtensionDisabledHack = FALSE;
#endif /* XINERAMA */
Expand Down Expand Up @@ -473,9 +472,9 @@ ProcessCommandLine(int argc, char *argv[])
UseMsg();
}
else if (strcmp(argv[i], "-byteswappedclients") == 0) {
AllowByteSwappedClients = FALSE;
dixSettingAllowByteSwappedClients = FALSE;
} else if (strcmp(argv[i], "+byteswappedclients") == 0) {
AllowByteSwappedClients = TRUE;
dixSettingAllowByteSwappedClients = TRUE;
}
else if (strcmp(argv[i], "-br") == 0); /* default */
else if (strcmp(argv[i], "+bs") == 0)
Expand Down
Loading