2009-10-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed wrong insertion point for BasicCred.
	* src/AuthConfigFactory.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-10-18 09:10:26 +00:00
parent 4536bd7211
commit 947effdf1c
2 changed files with 9 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2009-10-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed wrong insertion point for BasicCred.
* src/AuthConfigFactory.cc
2009-10-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2009-10-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Allowed non-regular file in LocalFilePathOptionHandler Allowed non-regular file in LocalFilePathOptionHandler

View File

@ -164,20 +164,17 @@ bool AuthConfigFactory::activateBasicCred
(const std::string& host, const std::string& path, const Option* op) (const std::string& host, const std::string& path, const Option* op)
{ {
std::deque<BasicCred>::iterator i = std::deque<BasicCred>::iterator i = findBasicCred(host, path);
findBasicCred(host, path);
if(i == _basicCreds.end()) { if(i == _basicCreds.end()) {
SharedHandle<AuthConfig> authConfig = SharedHandle<AuthConfig> authConfig =
createHttpAuthResolver(op)->resolveAuthConfig(host); createHttpAuthResolver(op)->resolveAuthConfig(host);
if(authConfig.isNull()) { if(authConfig.isNull()) {
return false; return false;
} else { } else {
BasicCred bc("", "", host, path); BasicCred bc(authConfig->getUser(), authConfig->getPassword(),
host, path, true);
i = std::lower_bound(_basicCreds.begin(), _basicCreds.end(), bc); i = std::lower_bound(_basicCreds.begin(), _basicCreds.end(), bc);
// TODO setting "/" as path. Should we use path instead? _basicCreds.insert(i, bc);
_basicCreds.insert
(i, BasicCred(authConfig->getUser(), authConfig->getPassword(),
host, "/", true));
return true; return true;
} }
} else { } else {