src/lib/udc.c 1.16
1.16 2009/04/17 19:41:26 galt
removing user:pwd@ from head of afterProtocol so that the sensitive login info is not replicated into the udcCache path
Index: src/lib/udc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/udc.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -b -B -U 4 -r1.15 -r1.16
--- src/lib/udc.c 15 Mar 2009 00:17:14 -0000 1.15
+++ src/lib/udc.c 17 Apr 2009 19:41:26 -0000 1.16
@@ -619,8 +619,19 @@
protocol = cloneStringZ(url, colonPos);
afterProtocol = url + colonPos + 1;
while (afterProtocol[0] == '/')
afterProtocol += 1;
+ char *userPwd = strchr(afterProtocol, '@');
+ if (userPwd)
+ {
+ char *afterHost = strchr(afterProtocol, '/');
+ if (!afterHost)
+ {
+ afterHost = afterProtocol+strlen(afterProtocol);
+ }
+ if (userPwd < afterHost)
+ afterProtocol = userPwd + 1;
+ }
afterProtocol = qEncode(afterProtocol);
}
else
{