curl-7.13.1-auth.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --- curl-7.13.1/lib/http.c.pom 2005-02-19 00:53:07.000000000 +0100
  2. +++ curl-7.13.1/lib/http.c 2005-04-27 11:48:40.000000000 +0200
  3. @@ -455,6 +455,7 @@
  4. /* To prevent the user+password to get sent to other than the original
  5. host due to a location-follow, we do some weirdo checks here */
  6. if(!data->state.this_is_a_follow ||
  7. + conn->bits.netrc ||
  8. !data->state.first_host ||
  9. curl_strequal(data->state.first_host, conn->host.name) ||
  10. data->set.http_disable_hostname_check_before_authentication) {
  11. --- curl-7.13.1/lib/url.c.pom 2005-02-09 23:47:57.000000000 +0100
  12. +++ curl-7.13.1/lib/url.c 2005-04-27 11:45:59.000000000 +0200
  13. @@ -3131,15 +3131,23 @@
  14. user, passwd);
  15. }
  16. + conn->bits.netrc = FALSE;
  17. if (data->set.use_netrc != CURL_NETRC_IGNORED) {
  18. if(Curl_parsenetrc(conn->host.name,
  19. user, passwd,
  20. data->set.netrc_file)) {
  21. - infof(data, "Couldn't find host %s in the " DOT_CHAR "netrc file, using defaults\n",
  22. + infof(data, "Couldn't find host %s in the " DOT_CHAR
  23. + "netrc file, using defaults\n",
  24. conn->host.name);
  25. }
  26. - else
  27. + else {
  28. + /* set bits.netrc TRUE to remember that we got the name from a .netrc
  29. + file, so that it is safe to use even if we followed a Location: to a
  30. + different host or similar. */
  31. + conn->bits.netrc = TRUE;
  32. +
  33. conn->bits.user_passwd = 1; /* enable user+password */
  34. + }
  35. }
  36. /* If our protocol needs a password and we have none, use the defaults */
  37. --- curl-7.13.1/lib/urldata.h.pom 2005-02-09 14:06:56.000000000 +0100
  38. +++ curl-7.13.1/lib/urldata.h 2005-04-27 11:50:31.000000000 +0200
  39. @@ -388,6 +388,7 @@
  40. bool ftp_use_lprt; /* As set with CURLOPT_FTP_USE_EPRT, but if we find out
  41. LPRT doesn't work we disable it for the forthcoming
  42. requests */
  43. + bool netrc; /* name+password provided by netrc */
  44. };
  45. struct hostname {