Author: des
Date: Mon Apr 30 12:12:48 2012
New Revision: 234838
URL: http://svn.freebsd.org/changeset/base/234838

Log:
  Don't reuse credentials if redirected to a different host.
  
  Submitted by: Niels Heinen <hein...@google.com>
  MFC after:    3 weeks

Modified:
  head/lib/libfetch/http.c

Modified: head/lib/libfetch/http.c
==============================================================================
--- head/lib/libfetch/http.c    Mon Apr 30 12:11:45 2012        (r234837)
+++ head/lib/libfetch/http.c    Mon Apr 30 12:12:48 2012        (r234838)
@@ -1779,7 +1779,9 @@ http_request(struct url *URL, const char
                                        DEBUG(fprintf(stderr, "failed to parse 
new URL\n"));
                                        goto ouch;
                                }
-                               if (!*new->user && !*new->pwd) {
+
+                               /* Only copy credentials if the host matches */
+                               if (!strcmp(new->host, url->host) && 
!*new->user && !*new->pwd) {
                                        strcpy(new->user, url->user);
                                        strcpy(new->pwd, url->pwd);
                                }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to