diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-01-29 17:18:44 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-01-29 17:18:44 +0100 |
commit | f241ad21e43624aaf0b059885a81794b732f1a94 (patch) | |
tree | 7e80a80af806efff7062d1b26a0eb297bce3752c /src/Daemon/Settings.cpp | |
parent | 6b0894cdb41d9698e593af717f4857313ea81c22 (diff) | |
download | abrt-f241ad21e43624aaf0b059885a81794b732f1a94.tar.gz abrt-f241ad21e43624aaf0b059885a81794b732f1a94.tar.xz abrt-f241ad21e43624aaf0b059885a81794b732f1a94.zip |
moved the gpg key list from abrt.conf to gpg_keys file
- this should allow us to update the gpg_keys list when
needed and will prevent the situation when user changed
his abrt.conf
Diffstat (limited to 'src/Daemon/Settings.cpp')
-rw-r--r-- | src/Daemon/Settings.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp index 6cf32a68..725c0d2a 100644 --- a/src/Daemon/Settings.cpp +++ b/src/Daemon/Settings.cpp @@ -151,11 +151,6 @@ static void ParseCommon() { g_settings_bOpenGPGCheck = string_to_bool(it->second.c_str()); } - it = s_mapSectionCommon.find("OpenGPGPublicKeys"); - if (it != end) - { - g_settings_setOpenGPGPublicKeys = ParseList(it->second.c_str()); - } it = s_mapSectionCommon.find("BlackList"); if (it != end) { @@ -246,6 +241,26 @@ static void ParseAnalyzerActionsAndReporters() } } +static void LoadGPGKeys() +{ + std::ifstream fIn; + fIn.open(CONF_DIR"/gpg_keys"); + if (fIn.is_open()) + { + std::string line; + /* every line is one key + FIXME: make it more robust, it doesn't handle comments + */ + while (fIn.good()) + { + getline(fIn, line); + if (line[0] == '/') // probably the begining of path, so let's handle it as a key + g_settings_setOpenGPGPublicKeys.insert(line); + } + fIn.close(); + } +} + /* abrt daemon loads .conf file */ void LoadSettings() { @@ -255,7 +270,7 @@ void LoadSettings() { std::string line; std::string section; - while (!fIn.eof()) + while (fIn.good()) { getline(fIn, line); @@ -345,6 +360,8 @@ void LoadSettings() ParseCommon(); ParseAnalyzerActionsAndReporters(); ParseCron(); + if(g_settings_bOpenGPGCheck) + LoadGPGKeys(); } /* dbus call to retrieve .conf file data from daemon */ |