diff options
author | Eric Anholt <eric@anholt.net> | 2014-04-23 09:52:17 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-04-23 13:24:22 -0700 |
commit | 99f0365b1fbdfd9238b9f5cc28491e4e6c7324f1 (patch) | |
tree | 530436cb2e3c912de628edec9cd034b6daa7ade1 /os | |
parent | a4d96afdbddb7a636df8e336059d3a5624f2e6ae (diff) |
Add a command line argument for disabling indirect GLX.
The attack surface for indirect GLX is huge, and it's of no use to
most people (if you get an indirect GL context, you're better served
by a immediate X error than actually trying to use an indirect GL
context and finding out that it doesn't support doing anything you
want, slowly). This flag gives you a chance to disable indirect GLX
in environments where you just don't need it.
I put in both the '+' and '-' arguments right now, so that it's easy
to patch the value to change the default policy.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os')
-rw-r--r-- | os/utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/utils.c b/os/utils.c index 83d85cdda..bc5e7df4d 100644 --- a/os/utils.c +++ b/os/utils.c @@ -194,6 +194,8 @@ Bool noGEExtension = FALSE; Bool CoreDump; +Bool enableIndirectGLX = TRUE; + #ifdef PANORAMIX Bool PanoramiXExtensionDisabledHack = FALSE; #endif @@ -538,6 +540,8 @@ UseMsg(void) ErrorF("-fn string default font name\n"); ErrorF("-fp string default font path\n"); ErrorF("-help prints message with these options\n"); + ErrorF("+iglx Allow creating indirect GLX contexts (default)\n"); + ErrorF("-iglx Prohibit creating indirect GLX contexts\n"); ErrorF("-I ignore all remaining arguments\n"); #ifdef RLIMIT_DATA ErrorF("-ld int limit data space to N Kb\n"); @@ -784,6 +788,10 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); exit(0); } + else if (strcmp(argv[i], "+iglx") == 0) + enableIndirectGLX = TRUE; + else if (strcmp(argv[i], "-iglx") == 0) + enableIndirectGLX = FALSE; else if ((skip = XkbProcessArguments(argc, argv, i)) != 0) { if (skip > 0) i += skip - 1; |