summaryrefslogtreecommitdiffstats
path: root/src/Daemon/Settings.cpp
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2010-01-29 17:20:37 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2010-01-29 17:20:37 +0100
commit23527cf9f3cf266626fb359838b6ddea9692d50d (patch)
treed2dcbbbd1875175ad15a28bdd1007e842c22507b /src/Daemon/Settings.cpp
parent3583c9184c37fc13e9a5135a8d99312bfceaa39c (diff)
parentf241ad21e43624aaf0b059885a81794b732f1a94 (diff)
downloadabrt-23527cf9f3cf266626fb359838b6ddea9692d50d.tar.gz
abrt-23527cf9f3cf266626fb359838b6ddea9692d50d.tar.xz
abrt-23527cf9f3cf266626fb359838b6ddea9692d50d.zip
Merge branch 'master' into rhel6
Conflicts: src/Daemon/abrt.conf
Diffstat (limited to 'src/Daemon/Settings.cpp')
-rw-r--r--src/Daemon/Settings.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp
index 6cf32a6..725c0d2 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 */