mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
[7/9] Remove the DBUS_Rule class
DBUS_Rule (in rules.py) was added in r2424 as a "this is how it should look like" proof of concept, but was never used. We have a "real" class for dbus rules now, so we can drop the proof of concept class. Also remove a commented, old version of RE_DBUS_ENTRY from aa.py Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
@@ -3050,9 +3050,6 @@ def parse_profile_data(data, file, do_include):
|
||||
|
||||
return profile_data
|
||||
|
||||
# RE_DBUS_ENTRY = re.compile('^dbus\s*()?,\s*$')
|
||||
# use stuff like '(?P<action>(send|write|w|receive|read|r|rw))'
|
||||
|
||||
def parse_mount_rule(line):
|
||||
# XXX Do real parsing here
|
||||
return aarules.Raw_Mount_Rule(line)
|
||||
|
@@ -8,42 +8,6 @@
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
class DBUS_Rule(object):
|
||||
actions = set()
|
||||
busses = set()
|
||||
names = set()
|
||||
paths = set()
|
||||
interfaces = set()
|
||||
members = set()
|
||||
peer_names = set()
|
||||
peer_labels = set()
|
||||
|
||||
audit = False
|
||||
deny = False
|
||||
|
||||
def __init__(self, actions=[], busses=[], names=[], paths=[], interfaces=[],
|
||||
members=[], peer_names=[], peer_labels=[]):
|
||||
self.actions = set(actions)
|
||||
self.busses = set(busses)
|
||||
self.names = set(names)
|
||||
self.paths = set(paths)
|
||||
self.interfaces = set(interfaces)
|
||||
self.members = set(members)
|
||||
self.peer_name = set(peer_names)
|
||||
self.peer_labels = set(peer_labels)
|
||||
|
||||
def serialize(self):
|
||||
out = "%s%s%s" % ('audit ' if self.audit else '',
|
||||
'deny ' if self.deny else '',
|
||||
'dbus')
|
||||
if len(self.actions) > 0:
|
||||
if len(self.actions) == 1:
|
||||
out += ' %s' % self.actions[0]
|
||||
else:
|
||||
out += ' (%s)' % (', '.join(self.actions))
|
||||
out += ','
|
||||
return out
|
||||
|
||||
class _Raw_Rule(object):
|
||||
audit = False
|
||||
deny = False
|
||||
|
Reference in New Issue
Block a user