Author: jkupec Date: Thu Sep 25 23:19:04 2008 New Revision: 11176 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11176&view=rev Log: - ZConfig::credentialsGlobal{File,Dir}() added (/etc/zypp/credentials.{cat,d}) Modified: trunk/libzypp/zypp.conf trunk/libzypp/zypp/ZConfig.cc trunk/libzypp/zypp/ZConfig.h trunk/libzypp/zypp/media/CredentialManager.cc Modified: trunk/libzypp/zypp.conf URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp.conf?rev=11176&r1=11175&r2=11176&view=diff ============================================================================== --- trunk/libzypp/zypp.conf (original) +++ trunk/libzypp/zypp.conf Thu Sep 25 23:19:04 2008 @@ -261,3 +261,27 @@ ## Default value: /var/log/zypp/history ## # history.logfile = /var/log/zypp/history + +## +## Global credentials directory path. +## +## If a URL contains ?credentials=<filename> parameter, the credentials will +## be stored and looked for in a file named <filename> in this directory. +## +## Valid values: absolute path to a directory +## Default value: /var/log/zypp/history +## +# credentials.global.dir = /etc/zypp/credentials.d + +## +## Global credentials catalog file path. +## +## This file contains a catalog of all known user credentials which were +## not stored via the ?credentials=<filename> URL parameter, i.e. passed +## in URL as username:password component, or entered by user in +## an authentication dialog. +## +## Valid values: absolute path to a file +## Default value: /etc/zypp/credentials.cat +## +# credentials.global.file = /etc/zypp/credentials.cat Modified: trunk/libzypp/zypp/ZConfig.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.cc?rev=11176&r1=11175&r2=11176&view=diff ============================================================================== --- trunk/libzypp/zypp/ZConfig.cc (original) +++ trunk/libzypp/zypp/ZConfig.cc Thu Sep 25 23:19:04 2008 @@ -286,6 +286,14 @@ { history_log_path = Pathname(value); } + else if ( entry == "credentials.global.dir" ) + { + credentials_global_dir_path = Pathname(value); + } + else if ( entry == "credentials.global.file" ) + { + credentials_global_file_path = Pathname(value); + } } } } @@ -349,6 +357,8 @@ target::rpm::RpmInstFlags rpmInstallFlags; Pathname history_log_path; + Pathname credentials_global_dir_path; + Pathname credentials_global_file_path; }; /////////////////////////////////////////////////////////////////// @@ -569,6 +579,18 @@ } + Pathname ZConfig::credentialsGlobalDir() const + { + return ( _pimpl->credentials_global_dir_path.empty() ? + Pathname("/etc/zypp/credentials.d") : _pimpl->credentials_global_dir_path ); + } + + Pathname ZConfig::credentialsGlobalFile() const + { + return ( _pimpl->credentials_global_file_path.empty() ? + Pathname("/etc/zypp/credentials.cat") : _pimpl->credentials_global_file_path ); + } + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/ZConfig.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.h?rev=11176&r1=11175&r2=11176&view=diff ============================================================================== --- trunk/libzypp/zypp/ZConfig.h (original) +++ trunk/libzypp/zypp/ZConfig.h Thu Sep 25 23:19:04 2008 @@ -232,6 +232,16 @@ * \see http://en.opensuse.org/Libzypp/Package_History */ Pathname historyLogFile() const; + + /** + * Defaults to /etc/zypp/credentials.d + */ + Pathname credentialsGlobalDir() const; + + /** + * Defaults to /etc/zypp/credentials.cat + */ + Pathname credentialsGlobalFile() const; public: class Impl; Modified: trunk/libzypp/zypp/media/CredentialManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/CredentialManager.cc?rev=11176&r1=11175&r2=11176&view=diff ============================================================================== --- trunk/libzypp/zypp/media/CredentialManager.cc (original) +++ trunk/libzypp/zypp/media/CredentialManager.cc Thu Sep 25 23:19:04 2008 @@ -12,6 +12,7 @@ #include <iostream> #include <fstream> +#include "zypp/ZConfig.h" #include "zypp/base/Function.h" #include "zypp/base/Logger.h" #include "zypp/base/Easy.h" @@ -21,9 +22,7 @@ #include "zypp/media/CredentialManager.h" -#define CUSTOM_CREDENTIALS_FILE_DIR "/etc/zypp/credentials.d" -#define GLOBAL_CREDENTIALS_FILE "/etc/zypp/credentials.cat" -#define USER_CREDENTIALS_FILE ".zypp/credentials.cat" +#define USER_CREDENTIALS_FILE ".zypp/credentials.cat" using namespace std; @@ -42,8 +41,8 @@ ////////////////////////////////////////////////////////////////////// CredManagerOptions::CredManagerOptions(const Pathname & rootdir) - : globalCredFilePath(rootdir / GLOBAL_CREDENTIALS_FILE) - , customCredFileDir(rootdir / CUSTOM_CREDENTIALS_FILE_DIR) + : globalCredFilePath(rootdir / ZConfig::instance().credentialsGlobalFile()) + , customCredFileDir(rootdir / ZConfig::instance().credentialsGlobalDir()) { char * homedir = getenv("HOME"); if (homedir) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org