libreport/0005-trac-660-add-support-for-sendining-sensitive-data-ev.patch

59 lines
2.0 KiB
Diff

From 046a3ceb281888bc2cb026d29e3186b929fcceb7 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Wed, 8 Aug 2012 15:58:03 +0200
Subject: [PATCH 05/10] trac#660: add support for sendining-sensitive-data
event option
* configuration parser reads a value of the 'sendining-sensitive-data'
xml element
* the default value for this option is false
* the option means that 'an event sends possibly sensitive data somewhere'
* core file is an example of sensitive data
* this option is required for automatic execution of events from event
chain (a user have to get an approval)
Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
src/include/event_config.h | 1 +
src/lib/event_xml_parser.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/src/include/event_config.h b/src/include/event_config.h
index 15ebf52..0ca3bda 100644
--- a/src/include/event_config.h
+++ b/src/include/event_config.h
@@ -80,6 +80,7 @@ typedef struct
bool ec_exclude_binary_items;
long ec_minimal_rating;
bool ec_skip_review;
+ bool ec_sending_sensitive_data;
GList *options;
} event_config_t;
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
index cd99784..157b717 100644
--- a/src/lib/event_xml_parser.c
+++ b/src/lib/event_xml_parser.c
@@ -32,6 +32,7 @@
#define DEFAULT_VALUE_ELEMENT "default-value"
#define MINIMAL_RATING_ELEMENT "minimal-rating"
#define GUI_REVIEW_ELEMENTS "gui-review-elements"
+#define SENDING_SENSITIVE_DATA_ELEMENT "sending-sensitive-data"
#define REQUIRES_ELEMENT "requires-items"
#define EXCL_BY_DEFAULT_ELEMENT "exclude-items-by-default"
@@ -423,6 +424,10 @@ static void text(GMarkupParseContext *context,
{
ui->ec_skip_review = !string_to_bool(text_copy);
}
+ else if (strcmp(inner_element, SENDING_SENSITIVE_DATA_ELEMENT) == 0)
+ {
+ ui->ec_sending_sensitive_data = string_to_bool(text_copy);
+ }
}
free(text_copy);
}
--
1.7.11.2