## 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
{
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);
+ }
}
}
}
target::rpm::RpmInstFlags rpmInstallFlags;
Pathname history_log_path;
+ Pathname credentials_global_dir_path;
+ Pathname credentials_global_file_path;
};
///////////////////////////////////////////////////////////////////
}
+ 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
///////////////////////////////////////////////////////////////////
* \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;
#include <iostream>
#include <fstream>
+#include "zypp/ZConfig.h"
#include "zypp/base/Function.h"
#include "zypp/base/Logger.h"
#include "zypp/base/Easy.h"
#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;
//////////////////////////////////////////////////////////////////////
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)