Re: Disabling RECORD by default

2016-06-20 Thread Keith Packard
Adam Jackson  writes:

> Does this imply that XDMCP users don't deserve accessibility, since we
> can't get a peer gid from a TCP socket? Seems suboptimal.

Without additional work, you would have to choose between security or
functionality.

With a little work, one can imagine using the SECURITY extension to
construct a new authorization token that would be used to limit access
to the extensions needed for accessibility. Getting that integrated into
the desktop environment will take more work than the simple GID-based
access control I proposed, but it's all feasible.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2016-06-20 Thread Adam Jackson
On Tue, 2016-06-14 at 23:41 -0700, Keith Packard wrote:

> The alternative would be to use separate X authorization data, but
> unless that is protected in the file system from access by the normal
> user, it offers no actual security. Hence, any program needing the
> 'magic' X authorization data would need to be setuid/setgid anyways. So
> we might as well simplify life by just directly checking for the special
> uid or gid.

Does this imply that XDMCP users don't deserve accessibility, since we
can't get a peer gid from a TCP socket? Seems suboptimal.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2016-06-15 Thread Keith Packard
Peter Hutterer  writes:

> but note that syndaemon is a common user of RECORD, if it is disabled we
> fall back to regular querying of the keyboard state with all its
> drawbacks (unnecessary wakeups, missing of some key events, etc.)

Ok, I'm back revisiting this and have some new ideas.

First, we need to disable *all* of the testing extensions by default;
XTEST allows you to synthesize "real" keyboard events, and push random
input to applications. Matthew Garrett posted a fine demo of this
recently.

However, this really sucks as these extensions are awfully useful, both
for testing (meh), but more importantly, for accessibility. So, not
having access to them in the X server means not having a bunch of
accessibility. Not going to happen.

So, we need to have access to these extensions, but only for
applications that need it. We can make those setuid/setgid to some
suitable user or group and then just have the X server restrict access
based on the clients effective uid/gid values.

The alternative would be to use separate X authorization data, but
unless that is protected in the file system from access by the normal
user, it offers no actual security. Hence, any program needing the
'magic' X authorization data would need to be setuid/setgid anyways. So
we might as well simplify life by just directly checking for the special
uid or gid.

I think a special gid is probably the right idea; it means the
application would still be running as the current user, and hence able
to access the Xauthority file and read/write files owned by the user.

We can use this to protect lots of pieces of the system, from GetImage
to window properties.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-12-02 Thread Peter Hutterer

On 2/12/2015 18:12 , Keith Packard wrote:

Peter Hutterer  writes:


disable _the_ XTEST extension? in at least two places. One comment, just to
be annoying: I'd prefer this split in two patches, with the second one just
toggling the true/false switch for RECORD and having the git subject line of
"Disable RECORD by default". Makes it much easier to find in the log than
hiding it in the first paragraph.
Reviewed-by: Peter Hutterer  otherwise


Thanks for the suggestions; I'll get new patches out with these
changes.


but note that syndaemon is a common user of RECORD, if it is disabled we
fall back to regular querying of the keyboard state with all its
drawbacks (unnecessary wakeups, missing of some key events, etc.)
with the two other patches you're breaking the backup option, so anyone not
using libinput will lose the disable-while-typing feature.


Sounds like we need a sync timer for keyboard idle time then, and then
updates to syndaemon.


we have device idle timers, a client could just look at the idle timers 
of each device with a XIKeyClass and subscribe to those. Unfortunately 
the most common invocation of syndaemon is with the flag that ignores 
modifier keys so you can ctrl+click without having the touchpad disabled 
after pressing ctrl. You can't get that behaviour with idletimers and 
I'm a bit scared of any idletimer implementation that does that :)


Really, the only sensible solution is what we did with libinput, but 
that's not going to find its way back into synaptics.


Cheers,
  Peter

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-12-02 Thread Keith Packard
Peter Hutterer  writes:

> Really, the only sensible solution is what we did with libinput, but 
> that's not going to find its way back into synaptics.

Yeah, trading security for features only on non libinput-based systems
seems entirely reasonable to me.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-12-02 Thread Keith Packard
Peter Hutterer  writes:

> disable _the_ XTEST extension? in at least two places. One comment, just to
> be annoying: I'd prefer this split in two patches, with the second one just
> toggling the true/false switch for RECORD and having the git subject line of
> "Disable RECORD by default". Makes it much easier to find in the log than
> hiding it in the first paragraph.
> Reviewed-by: Peter Hutterer  otherwise

Thanks for the suggestions; I'll get new patches out with these
changes.

> but note that syndaemon is a common user of RECORD, if it is disabled we
> fall back to regular querying of the keyboard state with all its
> drawbacks (unnecessary wakeups, missing of some key events, etc.)
> with the two other patches you're breaking the backup option, so anyone not
> using libinput will lose the disable-while-typing feature.

Sounds like we need a sync timer for keyboard idle time then, and then
updates to syndaemon.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-12-01 Thread Peter Hutterer
On Mon, Nov 23, 2015 at 04:28:08PM -0800, Keith Packard wrote:
> Alan Coopersmith  writes:
> 
> > You need to make a similar update to xserver/man/Xserver.man, which
> > currently says:
> >
> > -tstdisables all testing extensions (e.g., XTEST,  XTrap,  
> > XTestEx-
> > tension1, RECORD).
> 
> Changed to:
> 
> .TP 8
> .B \-tst
> disables XTEST extension.

disable _the_ XTEST extension? in at least two places. One comment, just to
be annoying: I'd prefer this split in two patches, with the second one just
toggling the true/false switch for RECORD and having the git subject line of
"Disable RECORD by default". Makes it much easier to find in the log than
hiding it in the first paragraph.
Reviewed-by: Peter Hutterer  otherwise

but note that syndaemon is a common user of RECORD, if it is disabled we
fall back to regular querying of the keyboard state with all its
drawbacks (unnecessary wakeups, missing of some key events, etc.)

with the two other patches you're breaking the backup option, so anyone not
using libinput will lose the disable-while-typing feature.

Cheers,
   Peter

> From ff5b0d12391932b13cd93fddc802a01bd5e52f2b Mon Sep 17 00:00:00 2001
> From: Keith Packard 
> Date: Mon, 23 Nov 2015 14:49:33 -0800
> Subject: [PATCH xserver 2/3] Allow RECORD and XTEST to be controlled
>  separately [v3]
> 
> RECORD and XTEST were both controlled by the -tst server option and
> XTEST extension selection. Split these out and then make RECORD be
> disabled by default.
> 
> [v2] Remove -record/+record options (Alan Coopersmith)
> [v3] Update man page description of -tst option (Alan Coopersmith)
> 
> Signed-off-by: Keith Packard 
> ---
>  hw/xquartz/X11Application.m |  8 
>  include/globals.h   |  5 -
>  man/Xserver.man |  2 +-
>  mi/miinitext.c  |  9 ++---
>  os/utils.c  | 10 +++---
>  5 files changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
> index d2c5d30..1348480 100644
> --- a/hw/xquartz/X11Application.m
> +++ b/hw/xquartz/X11Application.m
> @@ -82,7 +82,7 @@ static dispatch_queue_t eventTranslationQueue;
>  #endif
>  #endif
>  
> -extern Bool noTestExtensions;
> +extern Bool noXTestExtension;
>  extern Bool noRenderExtension;
>  extern BOOL serverRunning;
>  
> @@ -901,7 +901,7 @@ cfarray_to_nsarray(CFArrayRef in)
>  darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
>default   :darwinDesiredDepth];
>  
> -noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
> +noXTestExtension = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
>   default   :FALSE];
>  
>  noRenderExtension = ![self prefs_get_boolean:@PREFS_RENDER_EXTENSION
> @@ -1592,7 +1592,7 @@ handle_mouse:
>  }
>  }
>  
> -if (!XQuartzServerVisible && noTestExtensions) {
> +if (!XQuartzServerVisible && noXTestExtension) {
>  #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
>  /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, 
> so we can't call xp_find_window from the Appkit thread */
>  xp_window_id wid = 0;
> @@ -1695,7 +1695,7 @@ handle_mouse:
>  /* If we're in the background, we need to send a MotionNotify event
>   * first, since we aren't getting them on background mouse motion
>   */
> -if (!XQuartzServerVisible && noTestExtensions) {
> +if (!XQuartzServerVisible && noXTestExtension) {
>  bgMouseLocationUpdated = FALSE;
>  DarwinSendPointerEvents(darwinPointer, MotionNotify, 0,
>  location.x, location.y,
> diff --git a/include/globals.h b/include/globals.h
> index 858c9a3..42f21ce 100644
> --- a/include/globals.h
> +++ b/include/globals.h
> @@ -23,7 +23,10 @@ extern _X_EXPORT int monitorResolution;
>  extern _X_EXPORT int defaultColorVisualClass;
>  
>  extern _X_EXPORT int GrabInProgress;
> -extern _X_EXPORT Bool noTestExtensions;
> +extern _X_EXPORT Bool noXTestExtension;
> +#ifdef XRECORD
> +extern _X_EXPORT Bool noRecordExtension;
> +#endif
>  extern _X_EXPORT char *SeatId;
>  extern _X_EXPORT char *ConnectionInfo;
>  extern _X_EXPORT sig_atomic_t inSignalContext;
> diff --git a/man/Xserver.man b/man/Xserver.man
> index 506e5bb..55a8d5b 100644
> --- a/man/Xserver.man
> +++ b/man/Xserver.man
> @@ -278,7 +278,7 @@ command line option.
>  sets default connection timeout in seconds.
>  .TP 8
>  .B \-tst
> -disables all testing extensions (e.g., XTEST, XTrap, XTestExtension1, 
> RECORD).
> +disables XTEST extension.
>  .TP 8
>  .B tty\fIxx\fP
>  ignored, for servers started the ancient way (from init).
> diff --git a/mi/miinitext.c b/mi/miinitext.c
> index 5fc44e3..a089a2c 100644
> --- a/mi/miinitext.c
> +++ 

Re: Disabling RECORD by default

2015-11-23 Thread Alan Coopersmith

+#ifdef XRECORD
+ErrorF("+recordenable RECORD extension\n");
+ErrorF("-recorddisable RECORD extension\n");
+#endif


Do we need to actually add specific +record & -record flags instead of just
using the generic +extension RECORD and -extension RECORD flags?

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-11-23 Thread Jeremy Huddleston Sequoia
The XQuartz option was meant mainly for RECORD.  I'll followup later to add a 
preference option for RECORD in XQuartz.

Reviewed-by: Jeremy Huddleston Sequoia 

--Jeremy


> On Nov 23, 2015, at 18:13, Keith Packard  wrote:
> 
> Keith Packard  writes:
> 
> Here's a patch, which first splits out the command line and config file
> options for XTEST and RECORD, and then disables RECORD by default but
> leaves XTEST enabled by default.
> 
> From 2f1872f518ca7640efc42870800536f8e45c4b23 Mon Sep 17 00:00:00 2001
> From: Keith Packard 
> Date: Mon, 23 Nov 2015 14:49:33 -0800
> Subject: [PATCH xserver] Allow RECORD and XTEST to be controlled separately
> 
> RECORD and XTEST were both controlled by the -tst server option and
> XTEST extension selection. Split these out and then make RECORD be
> disabled by default.
> 
> Signed-off-by: Keith Packard 
> ---
> hw/xquartz/X11Application.m |  8 
> include/globals.h   |  5 -
> mi/miinitext.c  |  9 ++---
> os/utils.c  | 20 +---
> 4 files changed, 31 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
> index d2c5d30..1348480 100644
> --- a/hw/xquartz/X11Application.m
> +++ b/hw/xquartz/X11Application.m
> @@ -82,7 +82,7 @@ static dispatch_queue_t eventTranslationQueue;
> #endif
> #endif
> 
> -extern Bool noTestExtensions;
> +extern Bool noXTestExtension;
> extern Bool noRenderExtension;
> extern BOOL serverRunning;
> 
> @@ -901,7 +901,7 @@ cfarray_to_nsarray(CFArrayRef in)
> darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
>   default   :darwinDesiredDepth];
> 
> -noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
> +noXTestExtension = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
>  default   :FALSE];
> 
> noRenderExtension = ![self prefs_get_boolean:@PREFS_RENDER_EXTENSION
> @@ -1592,7 +1592,7 @@ handle_mouse:
> }
> }
> 
> -if (!XQuartzServerVisible && noTestExtensions) {
> +if (!XQuartzServerVisible && noXTestExtension) {
> #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
> /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, 
> so we can't call xp_find_window from the Appkit thread */
> xp_window_id wid = 0;
> @@ -1695,7 +1695,7 @@ handle_mouse:
> /* If we're in the background, we need to send a MotionNotify event
>  * first, since we aren't getting them on background mouse motion
>  */
> -if (!XQuartzServerVisible && noTestExtensions) {
> +if (!XQuartzServerVisible && noXTestExtension) {
> bgMouseLocationUpdated = FALSE;
> DarwinSendPointerEvents(darwinPointer, MotionNotify, 0,
> location.x, location.y,
> diff --git a/include/globals.h b/include/globals.h
> index 858c9a3..42f21ce 100644
> --- a/include/globals.h
> +++ b/include/globals.h
> @@ -23,7 +23,10 @@ extern _X_EXPORT int monitorResolution;
> extern _X_EXPORT int defaultColorVisualClass;
> 
> extern _X_EXPORT int GrabInProgress;
> -extern _X_EXPORT Bool noTestExtensions;
> +extern _X_EXPORT Bool noXTestExtension;
> +#ifdef XRECORD
> +extern _X_EXPORT Bool noRecordExtension;
> +#endif
> extern _X_EXPORT char *SeatId;
> extern _X_EXPORT char *ConnectionInfo;
> extern _X_EXPORT sig_atomic_t inSignalContext;
> diff --git a/mi/miinitext.c b/mi/miinitext.c
> index 5fc44e3..a089a2c 100644
> --- a/mi/miinitext.c
> +++ b/mi/miinitext.c
> @@ -149,6 +149,9 @@ static ExtensionToggle ExtensionToggleList[] = {
> #ifdef RANDR
> {"RANDR", },
> #endif
> +#ifdef XRECORD
> +{"RECORD", },
> +#endif
> {"RENDER", },
> #ifdef XCSECURITY
> {"SECURITY", },
> @@ -179,7 +182,7 @@ static ExtensionToggle ExtensionToggleList[] = {
> #ifdef XSELINUX
> {"SELinux", },
> #endif
> -{"XTEST", },
> +{"XTEST", },
> #ifdef XV
> {"XVideo", },
> #endif
> @@ -245,7 +248,7 @@ static const ExtensionModule staticExtensions[] = {
> #endif
> {XInputExtensionInit, "XInputExtension", NULL},
> #ifdef XTEST
> -{XTestExtensionInit, XTestExtensionName, },
> +{XTestExtensionInit, XTestExtensionName, },
> #endif
> {BigReqExtensionInit, "BIG-REQUESTS", NULL},
> {SyncExtensionInit, "SYNC", NULL},
> @@ -285,7 +288,7 @@ static const ExtensionModule staticExtensions[] = {
> {DbeExtensionInit, "DOUBLE-BUFFER", },
> #endif
> #ifdef XRECORD
> -{RecordExtensionInit, "RECORD", },
> +{RecordExtensionInit, "RECORD", },
> #endif
> #ifdef DPMSExtension
> {DPMSExtensionInit, DPMSExtensionName, },
> diff --git a/os/utils.c b/os/utils.c
> index c4d013b..a285622 100644
> --- a/os/utils.c
> +++ b/os/utils.c
> @@ -122,7 +122,11 @@ __stdcall unsigned long GetTickCount(void);
> 
> #include "picture.h"
> 
> -Bool 

Disabling RECORD by default

2015-11-23 Thread Keith Packard
Keith Packard  writes:

Here's a patch, which first splits out the command line and config file
options for XTEST and RECORD, and then disables RECORD by default but
leaves XTEST enabled by default.

From 2f1872f518ca7640efc42870800536f8e45c4b23 Mon Sep 17 00:00:00 2001
From: Keith Packard 
Date: Mon, 23 Nov 2015 14:49:33 -0800
Subject: [PATCH xserver] Allow RECORD and XTEST to be controlled separately

RECORD and XTEST were both controlled by the -tst server option and
XTEST extension selection. Split these out and then make RECORD be
disabled by default.

Signed-off-by: Keith Packard 
---
 hw/xquartz/X11Application.m |  8 
 include/globals.h   |  5 -
 mi/miinitext.c  |  9 ++---
 os/utils.c  | 20 +---
 4 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index d2c5d30..1348480 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -82,7 +82,7 @@ static dispatch_queue_t eventTranslationQueue;
 #endif
 #endif
 
-extern Bool noTestExtensions;
+extern Bool noXTestExtension;
 extern Bool noRenderExtension;
 extern BOOL serverRunning;
 
@@ -901,7 +901,7 @@ cfarray_to_nsarray(CFArrayRef in)
 darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
   default   :darwinDesiredDepth];
 
-noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
+noXTestExtension = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
  default   :FALSE];
 
 noRenderExtension = ![self prefs_get_boolean:@PREFS_RENDER_EXTENSION
@@ -1592,7 +1592,7 @@ handle_mouse:
 }
 }
 
-if (!XQuartzServerVisible && noTestExtensions) {
+if (!XQuartzServerVisible && noXTestExtension) {
 #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so 
we can't call xp_find_window from the Appkit thread */
 xp_window_id wid = 0;
@@ -1695,7 +1695,7 @@ handle_mouse:
 /* If we're in the background, we need to send a MotionNotify event
  * first, since we aren't getting them on background mouse motion
  */
-if (!XQuartzServerVisible && noTestExtensions) {
+if (!XQuartzServerVisible && noXTestExtension) {
 bgMouseLocationUpdated = FALSE;
 DarwinSendPointerEvents(darwinPointer, MotionNotify, 0,
 location.x, location.y,
diff --git a/include/globals.h b/include/globals.h
index 858c9a3..42f21ce 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -23,7 +23,10 @@ extern _X_EXPORT int monitorResolution;
 extern _X_EXPORT int defaultColorVisualClass;
 
 extern _X_EXPORT int GrabInProgress;
-extern _X_EXPORT Bool noTestExtensions;
+extern _X_EXPORT Bool noXTestExtension;
+#ifdef XRECORD
+extern _X_EXPORT Bool noRecordExtension;
+#endif
 extern _X_EXPORT char *SeatId;
 extern _X_EXPORT char *ConnectionInfo;
 extern _X_EXPORT sig_atomic_t inSignalContext;
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 5fc44e3..a089a2c 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -149,6 +149,9 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef RANDR
 {"RANDR", },
 #endif
+#ifdef XRECORD
+{"RECORD", },
+#endif
 {"RENDER", },
 #ifdef XCSECURITY
 {"SECURITY", },
@@ -179,7 +182,7 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef XSELINUX
 {"SELinux", },
 #endif
-{"XTEST", },
+{"XTEST", },
 #ifdef XV
 {"XVideo", },
 #endif
@@ -245,7 +248,7 @@ static const ExtensionModule staticExtensions[] = {
 #endif
 {XInputExtensionInit, "XInputExtension", NULL},
 #ifdef XTEST
-{XTestExtensionInit, XTestExtensionName, },
+{XTestExtensionInit, XTestExtensionName, },
 #endif
 {BigReqExtensionInit, "BIG-REQUESTS", NULL},
 {SyncExtensionInit, "SYNC", NULL},
@@ -285,7 +288,7 @@ static const ExtensionModule staticExtensions[] = {
 {DbeExtensionInit, "DOUBLE-BUFFER", },
 #endif
 #ifdef XRECORD
-{RecordExtensionInit, "RECORD", },
+{RecordExtensionInit, "RECORD", },
 #endif
 #ifdef DPMSExtension
 {DPMSExtensionInit, DPMSExtensionName, },
diff --git a/os/utils.c b/os/utils.c
index c4d013b..a285622 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -122,7 +122,11 @@ __stdcall unsigned long GetTickCount(void);
 
 #include "picture.h"
 
-Bool noTestExtensions;
+Bool noXTestExtension;
+
+#ifdef XRECORD
+Bool noRecordExtension = TRUE;
+#endif
 
 #ifdef COMPOSITE
 Bool noCompositeExtension = FALSE;
@@ -567,6 +571,10 @@ UseMsg(void)
 ErrorF("-nopn  reject failure to listen on all ports\n");
 ErrorF("-r turns off auto-repeat\n");
 ErrorF("r  turns on auto-repeat \n");
+#ifdef XRECORD
+ErrorF("+recordenable RECORD 

Re: Disabling RECORD by default

2015-11-23 Thread Keith Packard
Alan Coopersmith  writes:

> Do we need to actually add specific +record & -record flags instead of just
> using the generic +extension RECORD and -extension RECORD flags?

Probably not.

From 528587382afb002e3efc8638e53fa4db77161307 Mon Sep 17 00:00:00 2001
From: Keith Packard 
Date: Mon, 23 Nov 2015 14:49:33 -0800
Subject: [PATCH xserver] Allow RECORD and XTEST to be controlled separately
 [v2]

RECORD and XTEST were both controlled by the -tst server option and
XTEST extension selection. Split these out and then make RECORD be
disabled by default.

[v2] Remove -record/+record options (Alan Coopersmith)

Signed-off-by: Keith Packard 
---
 hw/xquartz/X11Application.m |  8 
 include/globals.h   |  5 -
 mi/miinitext.c  |  9 ++---
 os/utils.c  | 10 +++---
 4 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index d2c5d30..1348480 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -82,7 +82,7 @@ static dispatch_queue_t eventTranslationQueue;
 #endif
 #endif
 
-extern Bool noTestExtensions;
+extern Bool noXTestExtension;
 extern Bool noRenderExtension;
 extern BOOL serverRunning;
 
@@ -901,7 +901,7 @@ cfarray_to_nsarray(CFArrayRef in)
 darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
   default   :darwinDesiredDepth];
 
-noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
+noXTestExtension = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
  default   :FALSE];
 
 noRenderExtension = ![self prefs_get_boolean:@PREFS_RENDER_EXTENSION
@@ -1592,7 +1592,7 @@ handle_mouse:
 }
 }
 
-if (!XQuartzServerVisible && noTestExtensions) {
+if (!XQuartzServerVisible && noXTestExtension) {
 #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so 
we can't call xp_find_window from the Appkit thread */
 xp_window_id wid = 0;
@@ -1695,7 +1695,7 @@ handle_mouse:
 /* If we're in the background, we need to send a MotionNotify event
  * first, since we aren't getting them on background mouse motion
  */
-if (!XQuartzServerVisible && noTestExtensions) {
+if (!XQuartzServerVisible && noXTestExtension) {
 bgMouseLocationUpdated = FALSE;
 DarwinSendPointerEvents(darwinPointer, MotionNotify, 0,
 location.x, location.y,
diff --git a/include/globals.h b/include/globals.h
index 858c9a3..42f21ce 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -23,7 +23,10 @@ extern _X_EXPORT int monitorResolution;
 extern _X_EXPORT int defaultColorVisualClass;
 
 extern _X_EXPORT int GrabInProgress;
-extern _X_EXPORT Bool noTestExtensions;
+extern _X_EXPORT Bool noXTestExtension;
+#ifdef XRECORD
+extern _X_EXPORT Bool noRecordExtension;
+#endif
 extern _X_EXPORT char *SeatId;
 extern _X_EXPORT char *ConnectionInfo;
 extern _X_EXPORT sig_atomic_t inSignalContext;
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 5fc44e3..a089a2c 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -149,6 +149,9 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef RANDR
 {"RANDR", },
 #endif
+#ifdef XRECORD
+{"RECORD", },
+#endif
 {"RENDER", },
 #ifdef XCSECURITY
 {"SECURITY", },
@@ -179,7 +182,7 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef XSELINUX
 {"SELinux", },
 #endif
-{"XTEST", },
+{"XTEST", },
 #ifdef XV
 {"XVideo", },
 #endif
@@ -245,7 +248,7 @@ static const ExtensionModule staticExtensions[] = {
 #endif
 {XInputExtensionInit, "XInputExtension", NULL},
 #ifdef XTEST
-{XTestExtensionInit, XTestExtensionName, },
+{XTestExtensionInit, XTestExtensionName, },
 #endif
 {BigReqExtensionInit, "BIG-REQUESTS", NULL},
 {SyncExtensionInit, "SYNC", NULL},
@@ -285,7 +288,7 @@ static const ExtensionModule staticExtensions[] = {
 {DbeExtensionInit, "DOUBLE-BUFFER", },
 #endif
 #ifdef XRECORD
-{RecordExtensionInit, "RECORD", },
+{RecordExtensionInit, "RECORD", },
 #endif
 #ifdef DPMSExtension
 {DPMSExtensionInit, DPMSExtensionName, },
diff --git a/os/utils.c b/os/utils.c
index c4d013b..a09440e 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -122,7 +122,11 @@ __stdcall unsigned long GetTickCount(void);
 
 #include "picture.h"
 
-Bool noTestExtensions;
+Bool noXTestExtension;
+
+#ifdef XRECORD
+Bool noRecordExtension = TRUE;
+#endif
 
 #ifdef COMPOSITE
 Bool noCompositeExtension = FALSE;
@@ -574,7 +578,7 @@ UseMsg(void)
 ErrorF("-t #   default pointer threshold (pixels/t)\n");
 ErrorF("-terminate terminate at server reset\n");
 ErrorF("-to #  connection time out\n");
-ErrorF("-tst   

Re: Disabling RECORD by default

2015-11-23 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> The XQuartz option was meant mainly for RECORD.  I'll followup later
> to add a preference option for RECORD in XQuartz.

I'm not surprised to hear that; XTEST is quite a bit more useful and
less scary.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-11-23 Thread Keith Packard
Emil Velikov  writes:

> Although TEST being unconditionally set (in configure.ac) we have the
> above guard and a second one in include/extinit.h. I take it that
> those are just left over from the olden days ?

Yes, I think so.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Disabling RECORD by default

2015-11-23 Thread Keith Packard
Alan Coopersmith  writes:

> You need to make a similar update to xserver/man/Xserver.man, which
> currently says:
>
> -tstdisables all testing extensions (e.g., XTEST,  XTrap,  
> XTestEx-
> tension1, RECORD).

Changed to:

.TP 8
.B \-tst
disables XTEST extension.

From ff5b0d12391932b13cd93fddc802a01bd5e52f2b Mon Sep 17 00:00:00 2001
From: Keith Packard 
Date: Mon, 23 Nov 2015 14:49:33 -0800
Subject: [PATCH xserver 2/3] Allow RECORD and XTEST to be controlled
 separately [v3]

RECORD and XTEST were both controlled by the -tst server option and
XTEST extension selection. Split these out and then make RECORD be
disabled by default.

[v2] Remove -record/+record options (Alan Coopersmith)
[v3] Update man page description of -tst option (Alan Coopersmith)

Signed-off-by: Keith Packard 
---
 hw/xquartz/X11Application.m |  8 
 include/globals.h   |  5 -
 man/Xserver.man |  2 +-
 mi/miinitext.c  |  9 ++---
 os/utils.c  | 10 +++---
 5 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index d2c5d30..1348480 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -82,7 +82,7 @@ static dispatch_queue_t eventTranslationQueue;
 #endif
 #endif
 
-extern Bool noTestExtensions;
+extern Bool noXTestExtension;
 extern Bool noRenderExtension;
 extern BOOL serverRunning;
 
@@ -901,7 +901,7 @@ cfarray_to_nsarray(CFArrayRef in)
 darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
   default   :darwinDesiredDepth];
 
-noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
+noXTestExtension = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
  default   :FALSE];
 
 noRenderExtension = ![self prefs_get_boolean:@PREFS_RENDER_EXTENSION
@@ -1592,7 +1592,7 @@ handle_mouse:
 }
 }
 
-if (!XQuartzServerVisible && noTestExtensions) {
+if (!XQuartzServerVisible && noXTestExtension) {
 #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so 
we can't call xp_find_window from the Appkit thread */
 xp_window_id wid = 0;
@@ -1695,7 +1695,7 @@ handle_mouse:
 /* If we're in the background, we need to send a MotionNotify event
  * first, since we aren't getting them on background mouse motion
  */
-if (!XQuartzServerVisible && noTestExtensions) {
+if (!XQuartzServerVisible && noXTestExtension) {
 bgMouseLocationUpdated = FALSE;
 DarwinSendPointerEvents(darwinPointer, MotionNotify, 0,
 location.x, location.y,
diff --git a/include/globals.h b/include/globals.h
index 858c9a3..42f21ce 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -23,7 +23,10 @@ extern _X_EXPORT int monitorResolution;
 extern _X_EXPORT int defaultColorVisualClass;
 
 extern _X_EXPORT int GrabInProgress;
-extern _X_EXPORT Bool noTestExtensions;
+extern _X_EXPORT Bool noXTestExtension;
+#ifdef XRECORD
+extern _X_EXPORT Bool noRecordExtension;
+#endif
 extern _X_EXPORT char *SeatId;
 extern _X_EXPORT char *ConnectionInfo;
 extern _X_EXPORT sig_atomic_t inSignalContext;
diff --git a/man/Xserver.man b/man/Xserver.man
index 506e5bb..55a8d5b 100644
--- a/man/Xserver.man
+++ b/man/Xserver.man
@@ -278,7 +278,7 @@ command line option.
 sets default connection timeout in seconds.
 .TP 8
 .B \-tst
-disables all testing extensions (e.g., XTEST, XTrap, XTestExtension1, RECORD).
+disables XTEST extension.
 .TP 8
 .B tty\fIxx\fP
 ignored, for servers started the ancient way (from init).
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 5fc44e3..a089a2c 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -149,6 +149,9 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef RANDR
 {"RANDR", },
 #endif
+#ifdef XRECORD
+{"RECORD", },
+#endif
 {"RENDER", },
 #ifdef XCSECURITY
 {"SECURITY", },
@@ -179,7 +182,7 @@ static ExtensionToggle ExtensionToggleList[] = {
 #ifdef XSELINUX
 {"SELinux", },
 #endif
-{"XTEST", },
+{"XTEST", },
 #ifdef XV
 {"XVideo", },
 #endif
@@ -245,7 +248,7 @@ static const ExtensionModule staticExtensions[] = {
 #endif
 {XInputExtensionInit, "XInputExtension", NULL},
 #ifdef XTEST
-{XTestExtensionInit, XTestExtensionName, },
+{XTestExtensionInit, XTestExtensionName, },
 #endif
 {BigReqExtensionInit, "BIG-REQUESTS", NULL},
 {SyncExtensionInit, "SYNC", NULL},
@@ -285,7 +288,7 @@ static const ExtensionModule staticExtensions[] = {
 {DbeExtensionInit, "DOUBLE-BUFFER", },
 #endif
 #ifdef XRECORD
-{RecordExtensionInit, "RECORD", },
+{RecordExtensionInit, "RECORD", },
 #endif
 #ifdef DPMSExtension
 {DPMSExtensionInit,