summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2010-01-29 17:18:44 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2010-01-29 17:18:44 +0100
commitf241ad21e43624aaf0b059885a81794b732f1a94 (patch)
tree7e80a80af806efff7062d1b26a0eb297bce3752c /src
parent6b0894cdb41d9698e593af717f4857313ea81c22 (diff)
downloadabrt-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')
-rw-r--r--src/Daemon/Makefile.am4
-rw-r--r--src/Daemon/Settings.cpp29
-rw-r--r--src/Daemon/abrt.conf4
-rw-r--r--src/Daemon/gpg_keys1
4 files changed, 29 insertions, 9 deletions
diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am
index 18fcd81..235b01b 100644
--- a/src/Daemon/Makefile.am
+++ b/src/Daemon/Makefile.am
@@ -40,7 +40,9 @@ dbusabrtconfdir = ${sysconfdir}/dbus-1/system.d/
dist_dbusabrtconf_DATA = dbus-abrt.conf
daemonconfdir = $(CONF_DIR)
-dist_daemonconf_DATA = abrt.conf
+dist_daemonconf_DATA = \
+ abrt.conf \
+ gpg_keys
polkitconfdir = ${datadir}/polkit-1/actions
dist_polkitconf_DATA = org.fedoraproject.abrt.policy
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 */
diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf
index c11afdf..2a3253c 100644
--- a/src/Daemon/abrt.conf
+++ b/src/Daemon/abrt.conf
@@ -1,9 +1,9 @@
[ Common ]
# With this option set to "yes",
# only crashes in signed packages will be analyzed.
+# the list of public keys used to check the signature is
+# in the file gpg_keys
OpenGPGCheck = yes
-# GPG keys
-OpenGPGPublicKeys = /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
# Blacklisted packages
BlackList = nspluginwrapper, valgrind, strace
# Which database plugin to use
diff --git a/src/Daemon/gpg_keys b/src/Daemon/gpg_keys
new file mode 100644
index 0000000..cde50f1
--- /dev/null
+++ b/src/Daemon/gpg_keys
@@ -0,0 +1 @@
+/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora