summaryrefslogtreecommitdiff
path: root/src/xcb_auth.c
AgeCommit message (Collapse)Author
2014-03-21Remove tabs and trailing whitespacesUli Schlachter
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-28Fix build of xcb_auth.c with XDMCP on WIN32Jon TURNEY
Fix a redefinition problem which shows up when building for _WIN32 and libXdmcp is installed, so HASXDMAUTH is enabled It seems this is a special place in xcb as it uses other X11 library headers here If HASXDMAUTH is defined, include the wrapped windows.h before any header which includes it unwrapped, to avoid conflicts with types defined in X headers We need to include config.h and check HASXDMAUTH to avoid an unconditional dependency on x11proto headers In file included from install/include/X11/Xdmcp.h:19:0, from git/xcb/libxcb/src/xcb_auth.c:52: install/include/X11/Xmd.h:120:14: error: conflicting types for 'INT32' /usr/i686-pc-mingw32/sys-root/mingw/include/basetsd.h:54:13: note: previous declaration of 'INT32' was here install/include/X11/Xmd.h:143:15: error: conflicting types for 'BOOL' /usr/i686-pc-mingw32/sys-root/mingw/include/windef.h:234:17: note: previous declaration of 'BOOL' was here Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-28Revert "Fix include order with Xdmcp on WIN32"Jeremy Huddleston
This reverts commit 0e9246def562be97cc816f824f702233a826ec56. This change caused build failures because <X11/Xdmcp.h> was never included under any circumstance. This is because the check for HASXDMAUTH was moved before the inclusion of config.h (via xcbint.h) which defined it. Found-by: Tinderbox Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-11Fix include order with Xdmcp on WIN32Ryan Pavlik
Fix a redefinition problem due to include order which shows up when building for _WIN32 and libXdmcp is installed, so HASXDMAUTH is enabled Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Julien Danjou <julien@danjou.info>
2012-01-11Fix WIN32 compilation after commit 163c47bdc0d32785d831e4c93fea9ab7e023446bJon TURNEY
WIN32 does not have arpa/inet.h, so do not try to include it unless _WIN32 is not defined Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Julien Danjou <julien@danjou.info>
2011-08-24Support pre-IPv6 systems (without getaddrinfo)Markus Duft
Some of these systems (eg. Interix on XP) are still in use. Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Peter Harris <pharris@opentext.com>
2011-03-24Prevent theoretical double free and leak on get_peer_sock_name.Rami Ylimäki
Variable new_sockname will leak and sockname will be double freed if both of the cases shown below are true. 1. realloc succeeds and doesn't return the original pointer 2. calling socket_func fails Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Arnaud Fontaine <arnau@debian.org> Signed-off-by: Peter Harris <pharris@opentext.com>
2010-11-23xcb_auth: Fix memory leak in _xcb_get_auth_info.Nick Bowler
If the initial get_peer_sock_name(getpeername ...) succeeds, the pointer to allocated memory is overwritten by the later call to get_peer_sock_name(getsockname ...). Fix that up by freeing the allocated memory before overwriting the pointer. Signed-off-by: Nick Bowler <nbowler@draconx.ca> Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-31Merge branch 'master' of git://github.com/topcat/xcb-win32Peter Harris
Conflicts: src/xcb_conn.c src/xcb_util.c Signed-off-by: Peter Harris <pharris@opentext.com>
2010-04-30Get rid of PATH_MAX and MAXPATHLENArnaud Fontaine
There could be no upper limit on the length of a path according to POSIX, therefore these macros may not be defined at all on some systems (such as GNU Hurd). Signed-off-by: Arnaud Fontaine <arnau@debian.org> Reviewed-by: Peter Harris <pharris@opentext.com>
2010-03-29windefs.h is now called xcb_windefs.h - changed all includes to reflect ↵Jeetu Golani
that.Replaced one instance ofWIN32 with _WIN32 in each xcb_in.c and xcb_conn.c
2010-03-26Win32 code for xcb-1.5Jeetu Golani
2010-03-13Fix authentication on hpux and HurdSamuel Thibault
libxcb's 010e5661 (Fix XDM-AUTHORIZATION-1 (bug #14202)) mistakenly inverted a few lines of code, making local socket authentication fail on hpux and Hurd: when getpeername fails, sockname needs to be initialized by getsockname before its address family can be checked. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-21Fix XDM-AUTHORIZATION-1 (bug #14202)Bart Massey
With this patch, we know use correctly the socket address or peer address for authentication purpose. Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10auth: use snprintf() return valueJulien Danjou
That save us from a strlen(). Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10auth: precompute authnameslenJulien Danjou
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-06Local socket connections do not work on hurd-i386Samuel Thibault
Local socket connections currently do not work on hurd-i386 because xcb_auth calls getpeername() on the client socket, but hurd-i386 does not implement anything in that case (I actually wonder what reasonable value could be returned). In such case the xcb code does not actually need the peer name anyway. Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-16Fix do_append() argumentsJulien Danjou
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-15Copy full IPv4 mapping (Bug #20665)Julien Danjou
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-08-28Set namelen unsignedJulien Danjou
Signed-off-by: Julien Danjou <julien@danjou.info>
2007-11-24make IPv6 optionalBart Massey
2006-11-21Replace uses of "long" with uint32_t, and similar; fixes 64-bit bugsJosh Triplett
2006-11-21Fix IP6 work for FreeBSD/Mac.Ian Osgood
2006-11-21Support XDM-AUTHORIZATION-1 on IPv6Josh Triplett
Commit by Jamey Sharp and Josh Triplett.
2006-11-20Refactor auth code to get display number from xcb_connectJosh Triplett
Change xcb_connect to pass the display number to _xcb_get_auth_info, which passes it to get_authptr. This allows get_authptr to stop hacking the display number out of the sockaddrs of various address families, such as port - X_TCP_PORT, or the number after the last X in the UNIX socket path. This also removes a portability bug introduced during the IPv6 changes: relying on '\0'-termination of the UNIX socket path in a sockaddr_un. Commit by Jamey Sharp and Josh Triplett.
2006-11-20Support authentication for IPv6 connectionsJosh Triplett
Support AF_INET6 in get_authptr, and refactor to use common code for IPv4 and v4-mapped IPv6 addresses. Commit by Jamey Sharp and Josh Triplett.
2006-09-23We do not conflict with Xmd.h anymore; remove the include hack from xcb_auth.cJosh Triplett
2006-09-23The Great XCB RenamingJosh Triplett
Rename API to follow a new naming convention: * XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES * xcb_functions_lowercase_with_underscores * xcb_types_lowercase_with_underscores_and_suffix_t * expand all abbreviations like "req", "rep", and "iter" Word boundaries for the names in the protocol descriptions fall: * Wherever the protocol descriptions already have an underscore * Between a lowercase letter and a subsequent uppercase letter * Before the last uppercase letter in a string of uppercase letters followed by a lowercase letter (such as in LSBFirst between LSB and First) * Before and after a string of digits (with exceptions for sized types like xcb_char2b_t and xcb_glx_float32_t to match the stdint.h convention) Also fix up some particular naming issues: * Rename shape_op and shape_kind to drop the "shape_" prefix, since otherwise these types end up as xcb_shape_shape_{op,kind}_t. * Remove leading underscores from enums in the GLX protocol description, previously needed to ensure a word separator, but now redundant. This renaming breaks code written for the previous API naming convention. The scripts in XCB's tools directory will convert code written for the old API to use the new API; they work well enough that we used them to convert the non-program-generated code in XCB, and when run on the old program-generated code, they almost exactly reproduce the new program-generated code (modulo whitespace and bugs in the old code generator). Authors: Vincent Torri, Thomas Hunger, Josh Triplett
2006-04-28Move the remainder of the constants in X.h into XML enumerations.Ian Osgood
Fix xcb_auth to use one of the new enumerations.
2006-03-16The typedefs replacing Xmd.h conflict with Xmd.h. Here is a hacky ↵Jamey Sharp
workaround: FIXME!
2006-03-13Remove dependencies on Xmd.h and X.hIan Osgood
(Still including X.h until defs are moved to xproto.xml and xcb-util and xcb-demo are fixed to use them.)
2006-03-13Remove last deprecation warning.Ian Osgood
2006-03-12Use libXdmcp, if available with XdmcpWrap, for XDM-AUTHORIZATION-1. Closes ↵Jamey Sharp
bug #6106.
2006-03-08Bugfix: null-terminate the path in sockaddr_un before using it.Ian Osgood
This may fix itermittant connect failures.
2006-02-18Remove xcl and CVSROOT.Josh Triplett