From: Amos Jeffries Date: Sun, 14 Aug 2011 03:20:59 +0000 (+1200) Subject: Bug 3289: cache manager parameters not parsed without password X-Git-Tag: take08~43^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5366b99ba268d371970f9156cd653ead10f81406;p=thirdparty%2Fsquid.git Bug 3289: cache manager parameters not parsed without password --- diff --git a/src/cache_manager.cc b/src/cache_manager.cc index bb00a4aa18..08492cd9c6 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -193,21 +193,15 @@ CacheManager::ParseUrl(const char *url) int len = strlen(url); Must(len > 0); t = sscanf(url, "cache_object://%[^/]/%[^@?]%n@%[^?]?%s", host, request, &pos, password, params); + if (t < 3) { + t = sscanf(url, "cache_object://%[^/]/%[^?]%n?%s", host, request, &pos, params); + } if (t < 1) { t = sscanf(url, "http://%[^/]/squid-internal-mgr/%[^?]%n?%s", host, request, &pos, params); } if (t < 1) { t = sscanf(url, "https://%[^/]/squid-internal-mgr/%[^?]%n?%s", host, request, &pos, params); } - debugs(16, 3, HERE << "HTTPS: t=" << t << ", host='" << host << "', request='" << request << "', pos=" << pos << - ", password='" << password << "', params='" << params << "'"); - - if (pos >0 && url[pos] == '?') { - ++pos; - if (pos < len) - xstrncpy(params, url + pos, sizeof(params)); - } - if (t < 2) xstrncpy(request, "menu", MAX_URL); @@ -221,6 +215,9 @@ CacheManager::ParseUrl(const char *url) } #endif + debugs(16, 3, HERE << "MGR request: t=" << t << ", host='" << host << "', request='" << request << "', pos=" << pos << + ", password='" << password << "', params='" << params << "'"); + Mgr::ActionProfile::Pointer profile = findAction(request); if (!profile) { debugs(16, DBG_IMPORTANT, "CacheManager::ParseUrl: action '" << request << "' not found");