Author: aschnell
Date: Tue Dec 18 12:34:31 2007
New Revision: 8118
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8118&view=rev
Log:
- fixed password handling in URLs (bug #347273)
Modified:
trunk/libzypp/package/libzypp.changes
trunk/libzypp/tests/repo/RepoVariables_test.cc
trunk/libzypp/zypp/RepoInfo.cc
trunk/libzypp/zypp/RepoManager.cc
trunk/libzypp/zypp/Url.cc
trunk/libzypp/zypp/repo/RepoType.h
trunk/libzypp/zypp/repo/RepoVariables.cc
trunk/libzypp/zypp/repo/RepoVariables.h
trunk/libzypp/zypp/url/UrlBase.cc
Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=8118&r1=8117&r2=8118&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Tue Dec 18 12:34:31 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Dec 18 12:28:22 CET 2007 - aschnell@suse.de
+
+- fixed password handling in URLs (bug #347273)
+
+-------------------------------------------------------------------
Mon Dec 17 13:47:44 CET 2007 - ma@suse.de
- Fixed default text locale detection not to use static variables. (#346872)
Modified: trunk/libzypp/tests/repo/RepoVariables_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/RepoVariables_test.cc?rev=8118&r1=8117&r2=8118&view=diff
==============================================================================
--- trunk/libzypp/tests/repo/RepoVariables_test.cc (original)
+++ trunk/libzypp/tests/repo/RepoVariables_test.cc Tue Dec 18 12:34:31 2007
@@ -24,14 +24,29 @@
void replace_test(const string &dir)
{
- RepoVariablesStringReplacer replacer;
-
- BOOST_CHECK_EQUAL(replacer("http://foo/$arch/bar"),
+ /* check RepoVariablesStringReplacer */
+
+ RepoVariablesStringReplacer replacer1;
+
+ BOOST_CHECK_EQUAL(replacer1("http://foo/$arch/bar"),
"http://foo/"+ ZConfig::instance().systemArchitecture().asString() + "/bar");
getZYpp()->setArchitecture(Arch("i686"));
- BOOST_CHECK_EQUAL(replacer("http://foo/$arch/bar/$basearch"),
+ BOOST_CHECK_EQUAL(replacer1("http://foo/$arch/bar/$basearch"),
"http://foo/i686/bar/i386");
+
+ /* check RepoVariablesUrlReplacer */
+
+ RepoVariablesUrlReplacer replacer2;
+
+ BOOST_CHECK_EQUAL(replacer2(Url("ftp://user:secret@site.org/$arch/")).asCompleteString(),
+ "ftp://user:secret@site.org/i686/");
+
+ BOOST_CHECK_EQUAL(replacer2(Url("http://user:my$arch@site.org/$basearch/")).asCompleteString(),
+ "http://user:my$arch@site.org/i386/");
+
+ BOOST_CHECK_EQUAL(replacer2(Url("http://site.org/update/?arch=$arch")).asCompleteString(),
+ "http://site.org/update/?arch=i686");
}
test_suite*
@@ -45,15 +60,15 @@
cout << "RepoVariables_test:"
" path to directory with test data required as parameter. Using " << datadir << endl;
//return (test_suite *)0;
-
+
}
else
{
datadir = argv[1];
}
-
+
test_suite* test= BOOST_TEST_SUITE("RepoVariables");
-
+
std::string const params[] = { datadir };
test->add(BOOST_PARAM_TEST_CASE(&replace_test,
(std::string const*)params, params+1));
Modified: trunk/libzypp/zypp/RepoInfo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.cc?rev=8118&r1=8117&r2=8118&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoInfo.cc (original)
+++ trunk/libzypp/zypp/RepoInfo.cc Tue Dec 18 12:34:31 2007
@@ -191,7 +191,7 @@
{
return alias();
}
-
+
repo::RepoVariablesStringReplacer replacer;
return replacer(_pimpl->name);
}
Modified: trunk/libzypp/zypp/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=8118&r1=8117&r2=8118&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.cc (original)
+++ trunk/libzypp/zypp/RepoManager.cc Tue Dec 18 12:34:31 2007
@@ -117,17 +117,17 @@
if ( !store.isCached(info.alias()) )
return;
-
+
MIL << info.alias() << " cleaning cache..." << endl;
data::RecordId id = store.lookupRepository(info.alias());
-
+
CombinedProgressData subprogrcv(progress);
-
+
store.cleanRepository(id, subprogrcv);
}
-
+
////////////////////////////////////////////////////////////////////////////
-
+
/**
* Reads RepoInfo's from a repo file.
*
@@ -249,7 +249,7 @@
static shared_ptr<Impl> _nullimpl( new Impl );
return _nullimpl;
}
-
+
private:
friend Impl * rwcowClone<Impl>( const Impl * rhs );
/** clone for RWCOW_pointer */
@@ -312,7 +312,7 @@
}
////////////////////////////////////////////////////////////////////////////
-
+
RepoStatus RepoManager::metadataStatus( const RepoInfo &info ) const
{
Pathname rawpath = rawcache_path_for_repoinfo( _pimpl->options, info );
@@ -519,7 +519,7 @@
ERR << "refresh check failed for " << url << endl;
ZYPP_RETHROW(e);
}
-
+
return true; // default
}
@@ -624,7 +624,7 @@
{
ZYPP_CAUGHT(e);
ERR << "Trying another url..." << endl;
-
+
// remember the exception caught for the *first URL*
// if all other URLs fail, the rexception will be thrown with the
// cause of the problem of the first URL remembered
@@ -680,7 +680,7 @@
MIL << info.alias() << " cache rebuild is forced" << endl;
}
}
-
+
needs_cleaning = true;
}
@@ -709,7 +709,7 @@
break;
}
-
+
switch ( repokind.toEnum() )
{
case RepoType::RPMMD_e :
@@ -769,7 +769,7 @@
return repo::RepoType::RPMMD;
if ( access.doesFileExist("/content") )
return repo::RepoType::YAST2;
-
+
// if it is a local url of type dir
if ( (! media::MediaManager::downloads(url)) && ( url.getScheme() == "dir" ) )
{
@@ -798,9 +798,9 @@
return repo::RepoType::NONE;
}
-
+
////////////////////////////////////////////////////////////////////////////
-
+
void RepoManager::cleanCache( const RepoInfo &info,
const ProgressData::ReceiverFnc & progressrcv )
{
@@ -833,7 +833,7 @@
progress.sendTo(ProgressReportAdaptor( progressrcv, report ));
//progress.sendTo( progressrcv );
progress.name(str::form(_("Reading repository '%s' cache"), info.name().c_str()));
-
+
cache::CacheStore store(_pimpl->options.repoCachePath);
if ( ! store.isCached( info.alias() ) )
@@ -842,9 +842,9 @@
MIL << "Repository " << info.alias() << " is cached" << endl;
data::RecordId id = store.lookupRepository(info.alias());
-
+
CombinedProgressData subprogrcv(progress);
-
+
repo::cached::RepoOptions opts( info, _pimpl->options.repoCachePath, id );
opts.readingResolvablesProgress = subprogrcv;
repo::cached::RepoImpl::Ptr repoimpl =
@@ -1031,7 +1031,7 @@
callback::SendReport<ProgressReport> report;
progress.sendTo( ProgressReportAdaptor( progressrcv, report ) );
progress.name(str::form(_("Removing repository '%s'"), info.name().c_str()));
-
+
MIL << "Going to delete repo " << info.alias() << endl;
std::list<RepoInfo> repos = knownRepositories();
Modified: trunk/libzypp/zypp/Url.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Url.cc?rev=8118&r1=8117&r2=8118&view=diff
==============================================================================
--- trunk/libzypp/zypp/Url.cc (original)
+++ trunk/libzypp/zypp/Url.cc Tue Dec 18 12:34:31 2007
@@ -9,6 +9,7 @@
/**
* \file zypp/Url.cc
*/
+
#include