From: Michael Andres Date: Wed, 31 Jul 2013 13:03:50 +0000 (+0200) Subject: No rpmdb key import in readony mode (bnc#828672) X-Git-Tag: upstream/14.27.0~244^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbdfd6d46db847e63cd8058612f7c50ea01c0c94;p=platform%2Fupstream%2Flibzypp.git No rpmdb key import in readony mode (bnc#828672) --- diff --git a/zypp/ZYppFactory.cc b/zypp/ZYppFactory.cc index 11a7435..45fc1c2 100644 --- a/zypp/ZYppFactory.cc +++ b/zypp/ZYppFactory.cc @@ -74,6 +74,11 @@ namespace zypp MIL << "ZYPP_READONLY promised." << endl; } + bool IGotIt() + { + return active; + } + ///////////////////////////////////////////////////////////////// } // namespace zypp_readonly_hack /////////////////////////////////////////////////////////////////// diff --git a/zypp/target/rpm/RpmDb.cc b/zypp/target/rpm/RpmDb.cc index c5faac5..cabb17c 100644 --- a/zypp/target/rpm/RpmDb.cc +++ b/zypp/target/rpm/RpmDb.cc @@ -58,6 +58,10 @@ using namespace zypp::filesystem; namespace zypp { + namespace zypp_readonly_hack + { + bool IGotIt(); // in readonly-mode + } namespace target { namespace rpm @@ -1031,6 +1035,13 @@ void RpmDb::importPubkey( const PublicKey & pubkey_r ) { FAILIFNOTINITIALIZED; + // bnc#828672: On the fly key import in READONLY + if ( zypp_readonly_hack::IGotIt() ) + { + WAR << "Key " << pubkey_r << " can not be imported. (READONLY MODE)" << endl; + return; + } + // check if the key is already in the rpm database Edition keyEd( pubkey_r.gpgPubkeyVersion(), pubkey_r.gpgPubkeyRelease() ); set rpmKeys = pubkeyEditions();