[apparmor] [patch] [7/9] Remove the DBUS_Rule class

Seth Arnold seth.arnold at canonical.com
Fri May 20 23:18:09 UTC 2016


On Sun, Dec 27, 2015 at 04:11:20PM +0100, Christian Boltz wrote:
> Hello,
> 
> 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
> 
> 
> [ 58-delete-DBUS_Rule-class.diff ]

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> --- utils/apparmor/rules.py     2015-12-26 15:10:02.313819739 +0100
> +++ utils/apparmor/rules.py     2015-12-26 15:11:59.149032447 +0100
> @@ -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
> === modified file ./utils/apparmor/aa.py
> --- utils/apparmor/aa.py        2015-12-27 15:37:32.297470567 +0100
> +++ utils/apparmor/aa.py        2015-12-27 15:24:39.034431798 +0100
> @@ -3131,9 +3131,6 @@
>  
>      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)
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160520/136f0b1e/attachment.pgp>


More information about the AppArmor mailing list