[Xcb] [PATCH] Fix authentication on hpux and Hurd
Barton C Massey
bart at cs.pdx.edu
Mon Mar 15 00:14:11 PDT 2010
Oops, my bad. Good catch. Thanks much for the patch.
Bart
In message <1268434292-11510-1-git-send-email-samuel.thibault at ens-lyon.org> you wrote:
> 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 at ens-lyon.org>
> ---
> src/xcb_auth.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/xcb_auth.c b/src/xcb_auth.c
> index 104f2f0..00aad23 100644
> --- a/src/xcb_auth.c
> +++ b/src/xcb_auth.c
> @@ -260,10 +260,10 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
> * case anyway.*/
> if (getpeername(fd, sockname, &socknamelen) == -1)
> {
> - if (sockname->sa_family != AF_UNIX)
> - return 0; /* except for AF_UNIX, sockets should have peernames */
> if (getsockname(fd, sockname, &socknamelen) == -1)
> return 0; /* can only authenticate sockets */
> + if (sockname->sa_family != AF_UNIX)
> + return 0; /* except for AF_UNIX, sockets should have peernames */
> gotsockname = 1;
> }
>
> --
> 1.7.0
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
More information about the Xcb
mailing list