Commit 74da13e7 authored by Steve Beattie's avatar Steve Beattie

utils: convert raw rules classes to subclass from _Raw_Rule

The patch that adds support for af_unix rules added a _Raw_Rule base
class to inherit from in rules.py. This patch converts the rest of the
raw rules classes to use the same.
Signed-off-by: Steve Beattie's avatarSteve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz's avatarChristian Boltz <apparmor@cboltz.de>
parent b86d8375
......@@ -56,65 +56,20 @@ class _Raw_Rule(object):
'deny ' if self.deny else '',
self.rule)
class Raw_DBUS_Rule(object):
audit = False
deny = False
def __init__(self, rule):
self.rule = rule
def serialize(self):
return "%s%s%s" % ('audit ' if self.audit else '',
'deny ' if self.deny else '',
self.rule)
class Raw_Mount_Rule(object):
audit = False
deny = False
def __init__(self, rule):
self.rule = rule
def serialize(self):
return "%s%s%s" % ('audit ' if self.audit else '',
'deny ' if self.deny else '',
self.rule)
class Raw_Signal_Rule(object):
audit = False
deny = False
def __init__(self, rule):
self.rule = rule
def serialize(self):
return "%s%s%s" % ('audit ' if self.audit else '',
'deny ' if self.deny else '',
self.rule)
class Raw_Ptrace_Rule(object):
audit = False
deny = False
def __init__(self, rule):
self.rule = rule
class Raw_DBUS_Rule(_Raw_Rule):
pass
def serialize(self):
return "%s%s%s" % ('audit ' if self.audit else '',
'deny ' if self.deny else '',
self.rule)
class Raw_Mount_Rule(_Raw_Rule):
pass
class Raw_Pivot_Root_Rule(object):
audit = False
deny = False
class Raw_Signal_Rule(_Raw_Rule):
pass
def __init__(self, rule):
self.rule = rule
class Raw_Ptrace_Rule(_Raw_Rule):
pass
def serialize(self):
return "%s%s%s" % ('audit ' if self.audit else '',
'deny ' if self.deny else '',
self.rule)
class Raw_Pivot_Root_Rule(_Raw_Rule):
pass
class Raw_Unix_Rule(_Raw_Rule):
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment