Commit Graph

15 Commits

Author SHA1 Message Date
Jon Turney 4055fed1e7 hw/xwin: Remove XSetAuthorization() for helper clients
All helper client code now uses xcb, so calling XSetAuthorization() is
no longer needed.

This is the last reference to libX11 from helper clients, so linking
with x11-xcb and libX11 is no longer required.

Also drop (unneeded?) linking with libXau.

Also drop installing these prerequistes on AppvVeyor.

Also move prototypes for functions in winauth.c from win.h into a new
header, winauth.h, and include that where needed.
2020-04-15 14:13:58 +00:00
Emil Velikov 1ef6569225 os: make MitGenerateCookie() independent of XCSECURITY
Analogous to previous commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:40 -04:00
Emil Velikov 292ee71516 os: make GenerateRandomData() independent of XCSECURITY
The function itself does not depend on the macro. Move it outside
of the ifdef guard and remove the identical copy in XWIN.

This is step 1 towards removing the duplication in winauth.c and moving
the OS specifics to os/

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:40 -04:00
Jon Turney a6288f0954 hw/xwin: xcbify internal window manager
Convert the code for the multiwindow mode internal window manager to xcb

xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type
sizing issues

v2: Various fixes
v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type
and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND
v4: Fix indentation, add some error handling.
Fix a bug with ConfigureNotify handling
v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:31:39 +01:00
Julien Cristau d0c1a5bc61 xwin: no need to free auth data if AddResource fails
This is taken care of by SecurityDeleteAuthorization

Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:20:00 -05:00
Jon TURNEY 561bca469d hw/xwin: Fix const discarded warning in winGenerateAuthorization()
Fix const discarded warning in winGenerateAuthorization() in !XCSECURITY case

In function ‘winGenerateAuthorization’:
hw/xwin/winauth.c:123:38: warning: passing argument 2 of ‘GenerateAuthorization’ discards ‘const’ qualifier from pointer target type [enabled by default]
hw/xwin/winauth.c:99:1: note: expected ‘char *’ but argument is of type ‘const char *’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-03-22 17:16:38 +00:00
Jon TURNEY 34932cef6c hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function ‘MitGenerateCookie’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function ‘MitAddCookie’ [-Werror=implicit-function-declaration]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:08 +01:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Colin Harrison cca4952d75 Xming: Warning fixes
Fix warnings due to prototypes not specifying function arguments
Fix warning with RegQueryValueEx()
Tidy up an include

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-03-16 13:56:58 +00:00
Jon TURNEY 0866322b57 Cygwin/X: Always use an authorization cookie for internal clients
Don't conditionalize use of an authorization cookie for internal client
threads on XCSECURITY, always use one (this avoids certain problems
with XDMCP setups where the XDMCP host removes localhost from the access
list etc.)

Conditionalize the use of a XCSECURITY authorization descriptor on XCSECURITY

Consolidate the various places where the authorization cookie is set
for internal threads into a new function, winSetAuthorization()

Use authorization cookie for multiwindow WM X message thread as well

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-11-09 20:33:44 +00:00
Alan Coopersmith d44b2a0a57 Move Xserver API for security extension to securitysrv.h 2006-06-20 18:22:51 -07:00
Alexander Gottwald 508cdb5cb0 Include xwin-config.h if HAVE_XWIN_CONFIG is defined Cleanup X11 includes
handling Warning fixes
2005-07-04 22:10:43 +00:00
Daniel Stone 292c4cff26 Fix includes right throughout the Xserver tree:
change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h;
change "foo.h", "extensions/foo.h" and "X11/foo.h" to
    <X11/extensions/foo.h> for extension headers, e.g. Xv.h;
change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.
2005-04-20 12:25:48 +00:00
Alexander Gottwald d6e8b1affe Bug 777: Merge from CYGWIN branch 2004-06-21 13:19:32 +00:00