[systemd-commits] src/bus-proxyd

Kay Sievers kay at kemper.freedesktop.org
Mon Jun 16 07:07:36 PDT 2014


 src/bus-proxyd/bus-policy.c |   17 ++++++++++++++---
 src/bus-proxyd/bus-policy.h |    1 +
 2 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit ba98e746e63d749ab2bf84c9e050206468019b7f
Author: Kay Sievers <kay at vrfy.org>
Date:   Mon Jun 16 16:03:30 2014 +0200

    bus-proxy: policy - ignore unsupported tags and attributes

diff --git a/src/bus-proxyd/bus-policy.c b/src/bus-proxyd/bus-policy.c
index c23d394..3f1d755 100644
--- a/src/bus-proxyd/bus-policy.c
+++ b/src/bus-proxyd/bus-policy.c
@@ -155,7 +155,10 @@ static int file_load(Policy *p, const char *path) {
                                 else if (streq(name, "group"))
                                         state = STATE_POLICY_GROUP;
                                 else {
-                                        log_warning("Attribute %s of <policy> tag unknown at %s:%u, ignoring.", name, path, line);
+                                        if (streq(name, "at_console"))
+                                                log_debug("Attribute %s of <policy> tag unsupported at %s:%u, ignoring.", name, path, line);
+                                        else
+                                                log_warning("Attribute %s of <policy> tag unknown at %s:%u, ignoring.", name, path, line);
                                         state = STATE_POLICY_OTHER_ATTRIBUTE;
                                 }
                         } else if (t == XML_TAG_CLOSE_EMPTY ||
@@ -268,7 +271,12 @@ static int file_load(Policy *p, const char *path) {
                                         ic = POLICY_ITEM_USER;
                                 else if (streq(name, "group"))
                                         ic = POLICY_ITEM_GROUP;
-                                else {
+                                else if (streq(name, "eavesdrop")) {
+                                        log_debug("Unsupported attribute %s= at %s:%u, ignoring.", name, path, line);
+                                        i->class = POLICY_ITEM_IGNORE;
+                                        state = STATE_ALLOW_DENY_OTHER_ATTRIBUTE;
+                                        break;
+                                } else {
                                         log_error("Unknown attribute %s= at %s:%u, ignoring.", name, path, line);
                                         state = STATE_ALLOW_DENY_OTHER_ATTRIBUTE;
                                         break;
@@ -303,7 +311,10 @@ static int file_load(Policy *p, const char *path) {
                                                  (streq(u, "sender") && ic == POLICY_ITEM_RECV))
                                                 state = STATE_ALLOW_DENY_NAME;
                                         else {
-                                                log_error("Unknown attribute %s= at %s:%u, ignoring.", name, path, line);
+                                                if (streq(u, "requested_reply"))
+                                                        log_debug("Unsupported attribute %s= at %s:%u, ignoring.", name, path, line);
+                                                else
+                                                        log_error("Unknown attribute %s= at %s:%u, ignoring.", name, path, line);
                                                 state = STATE_ALLOW_DENY_OTHER_ATTRIBUTE;
                                                 break;
                                         }
diff --git a/src/bus-proxyd/bus-policy.h b/src/bus-proxyd/bus-policy.h
index bad4256..a6ff5c3 100644
--- a/src/bus-proxyd/bus-policy.h
+++ b/src/bus-proxyd/bus-policy.h
@@ -42,6 +42,7 @@ typedef enum PolicyItemClass {
         POLICY_ITEM_OWN_PREFIX,
         POLICY_ITEM_USER,
         POLICY_ITEM_GROUP,
+        POLICY_ITEM_IGNORE,
         _POLICY_ITEM_CLASS_MAX,
         _POLICY_ITEM_CLASS_INVALID = -1,
 } PolicyItemClass;



More information about the systemd-commits mailing list