xauth.bc78aa61cfbddaa27dee275f639ba40de6981b17.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From bc78aa61cfbddaa27dee275f639ba40de6981b17 Mon Sep 17 00:00:00 2001
  2. From: George V. Kouryachy (Fr. Br. George) <george@altlinux.ru>
  3. Date: Fri, 4 Aug 2017 18:37:33 +0300
  4. Subject: [PATCH] parse_displayname: use FamilyWild for *:0
  5. ---
  6. xauth/gethost.c | 4 ++++
  7. xauth/parsedpy.c | 4 ++++
  8. 2 files changed, 8 insertions(+), 0 deletions(-)
  9. diff --git a/xauth/gethost.c b/xauth/gethost.c
  10. index 8cb58c5..598ac48 100644
  11. --- a/xauth/gethost.c
  12. +++ b/xauth/gethost.c
  13. @@ -180,6 +180,10 @@ struct addrlist *get_address_info (
  14. * information to be copied and set len to the number of bytes.
  15. */
  16. switch (family) {
  17. + case FamilyWild: /* was :0 */
  18. + src = "\xff\xff";
  19. + len = strlen(src);
  20. + break;
  21. case FamilyLocal: /* hostname/unix:0 */
  22. /* handle unix:0 and :0 specially */
  23. if (prefix == 0 && (strncmp (fulldpyname, "unix:", 5) == 0 ||
  24. diff --git a/xauth/parsedpy.c b/xauth/parsedpy.c
  25. index 97988d3..6c98339 100644
  26. --- a/xauth/parsedpy.c
  27. +++ b/xauth/parsedpy.c
  28. @@ -141,6 +141,10 @@ parse_displayname (const char *displayname,
  29. family = FamilyInternet;
  30. }
  31. #endif
  32. + } else if (len == 1 && *displayname == '*') {
  33. + /* ALT: wildcard cookie */
  34. + host = copystring("*", 1);
  35. + family = FamilyWild;
  36. } else if (!dnet && (*displayname == '[') && (*(ptr - 1) == ']')) {
  37. /* Allow RFC2732-like [<IPv6NumericAddress>]:display syntax */
  38. family = FamilyInternet6;
  39. --
  40. 1.7.3.3