1 diff --git a/sepolgen/src/sepolgen/matching.py b/sepolgen/src/sepolgen/matching.py
2 index 1a9a3e5..d56dd92 100644
3 --- a/sepolgen/src/sepolgen/matching.py
4 +++ b/sepolgen/src/sepolgen/matching.py
5 @@ -50,7 +50,7 @@ class Match:
9 - DEFAULT_THRESHOLD = 120
10 + DEFAULT_THRESHOLD = 150
12 # Match objects that pass the threshold
14 @@ -63,14 +63,15 @@ class MatchList:
16 if len(self.children):
17 return self.children[0]
20 + if len(self.bastards):
21 + return self.bastards[0]
25 # Only return the length of the matches so
26 # that this can be used to test if there is
28 - return len(self.children)
29 + return len(self.children) + len(self.bastards)
32 return iter(self.children)
33 diff --git a/sepolgen/src/sepolgen/policygen.py b/sepolgen/src/sepolgen/policygen.py
34 index 4882999..9dc2d32 100644
35 --- a/sepolgen/src/sepolgen/policygen.py
36 +++ b/sepolgen/src/sepolgen/policygen.py
37 @@ -30,7 +30,11 @@ import access
40 import selinux.audit2why as audit2why
41 -from setools import *
43 + from setools import *
44 + alldomains = seinfo(ATTRIBUTE, name="domain")[0]["types"]
48 # Constants for the level of explanation from the generation
50 @@ -79,7 +83,6 @@ class PolicyGenerator:
52 self.dontaudit = False
55 def set_gen_refpol(self, if_set=None, perm_maps=None):
56 """Set whether reference policy interfaces are generated.
58 @@ -175,13 +178,11 @@ class PolicyGenerator:
59 if av.type == audit2why.TERULE:
60 if "write" in av.perms:
61 if "dir" in av.obj_class or "open" in av.perms:
62 - if not self.domains:
63 - self.domains = seinfo(ATTRIBUTE, name="domain")[0]["types"]
67 for i in map(lambda x: x[TCONTEXT], sesearch([ALLOW], {SCONTEXT: av.src_type, CLASS: av.obj_class, PERMS: av.perms})):
68 - if i not in self.domains:
69 + if i not in alldomains:
72 rule.comment += "#!!!! The source type '%s' can write to a '%s' of the following type:\n# %s\n" % ( av.src_type, av.obj_class, ", ".join(types))
73 diff --git a/sepolgen/src/sepolgen/refparser.py b/sepolgen/src/sepolgen/refparser.py
74 index 9a79340..a4adbd8 100644
75 --- a/sepolgen/src/sepolgen/refparser.py
76 +++ b/sepolgen/src/sepolgen/refparser.py
77 @@ -245,7 +245,7 @@ def t_refpolicywarn(t):
81 - r'[a-zA-Z_\$\"][a-zA-Z0-9_\-\.\$\*\"~]*'
82 + r'[a-zA-Z_\$\"][a-zA-Z0-9_\-\+\.\$\*\"~]*'
84 t.type = reserved.get(t.value,'IDENTIFIER')