diff --git a/parser/tst/gen-xtrans.py b/parser/tst/gen-xtrans.py index 139fe1d8b..0ff169f16 100755 --- a/parser/tst/gen-xtrans.py +++ b/parser/tst/gen-xtrans.py @@ -120,8 +120,8 @@ def gen_file (name, xres, leading1, qual1, rule1, perm1, target1, leading2, qual # # will conflict # -# NOTE: conflict tests don't tests leading permissions or using unsafe keywords -# It is assumed that there are extra tests to verify 1 to 1 coorispondance +# NOTE: conflict tests don't test leading permissions or using unsafe keywords +# It is assumed that there are extra tests to verify 1 to 1 correspondance def gen_files(name, rule1, rule2, default): perms = gen_list() @@ -172,7 +172,7 @@ def gen_leading_perms (name, rule1, rule2): gen_file(file, "PASS", 0, q, rule1, i, t, 1, q, rule2, i, t) # test for rules with leading safe or unsafe keywords. -# check they are equivalent to their counter part, +# check they are equivalent to their counterpart, # or if $invert that they properly conflict with their counterpart def gen_safe_perms(name, xres, invert, rule1, rule2): perms = gen_list() diff --git a/utils/aa-notify b/utils/aa-notify index 024044a0c..650281682 100755 --- a/utils/aa-notify +++ b/utils/aa-notify @@ -162,7 +162,7 @@ def follow_apparmor_events(logfile, wait=0): '''Follow AppArmor events and yield relevant entries until process stops''' # If wait was given as argument but was type None (from ArgumentParser) - # ensure it type int and zero + # ensure it's type int and zero if not wait: wait = 0 @@ -518,7 +518,7 @@ def main(): os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path=/run/user/{}/bus'.format(os.geteuid()) # Before use, notify2 must be initialized and the DBUS channel - # should be opened using the non-root user. This this step needs to + # should be opened using the non-root user. This step needs to # be executed after the drop_privileges(). notify2.init('AppArmor') diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 3390a68ed..67b3fe432 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -1815,7 +1815,7 @@ def parse_profile_data(data, file, do_include, in_preamble): load_include(incname, in_preamble) elif RE_PROFILE_START.search(line) or RE_PROFILE_HAT_DEF.search(line): # Starting line of a profile/hat - # in_contained_hat is needed to know if we are already in a profile or not. (Simply checking if we are in a hat doesn't work, + # in_contained_hat is needed to know if we are already in a profile or not. Simply checking if we are in a hat doesn't work, # because something like "profile foo//bar" will set profile and hat at once, and later (wrongfully) expect another "}". # The logic is simple and resembles a "poor man's stack" (with limited/hardcoded height). if profile: diff --git a/utils/apparmor/config.py b/utils/apparmor/config.py index 9997655df..991c0ea77 100644 --- a/utils/apparmor/config.py +++ b/utils/apparmor/config.py @@ -219,7 +219,7 @@ class Config(object): if os.path.exists(self.input_file): with open_file_read(self.input_file) as f_in: for line in f_in: - # If its a section + # If it's a section if line.lstrip().startswith('['): # If any options from preceding section remain write them if options: diff --git a/utils/apparmor/easyprof.py b/utils/apparmor/easyprof.py index a00092cc2..acadca144 100644 --- a/utils/apparmor/easyprof.py +++ b/utils/apparmor/easyprof.py @@ -680,7 +680,7 @@ class AppArmorEasyProfile: else: # should not ever reach this raise AppArmorException("Could not determine output filename") - # Generate an absolute path, convertng any path delimiters to '.' + # Generate an absolute path, converting any path delimiters to '.' out_fn = os.path.join(dir, re.sub(r'/', '.', out_fn.lstrip('/'))) if os.path.exists(out_fn): raise AppArmorException("'%s' already exists" % out_fn) diff --git a/utils/test/test-alias.py b/utils/test/test-alias.py index 2be36e1e6..f9b6a3a99 100644 --- a/utils/test/test-alias.py +++ b/utils/test/test-alias.py @@ -30,7 +30,7 @@ exp = namedtuple('exp', ['comment', class AliasTest(AATest): def _compare_obj(self, obj, expected): - # aliass don't support the allow, audit or deny keyword + # aliases don't support the allow, audit or deny keyword self.assertEqual(False, obj.allow_keyword) self.assertEqual(False, obj.audit) self.assertEqual(False, obj.deny) diff --git a/utils/test/test-profile-list.py b/utils/test/test-profile-list.py index dd238ce8b..cdaf291bc 100644 --- a/utils/test/test-profile-list.py +++ b/utils/test/test-profile-list.py @@ -62,7 +62,7 @@ class TestAdd_profile(AATest): def testAdd_profileError_2(self): with self.assertRaises(AppArmorBug): - self.pl.add_profile('/etc/apparmor.d/bin.foo', None, None, self.dummy_profile) # neither attachment or profile name + self.pl.add_profile('/etc/apparmor.d/bin.foo', None, None, self.dummy_profile) # neither attachment nor profile name def testAdd_profileError_list_nonexisting_file(self): self.pl.add_profile('/etc/apparmor.d/bin.foo', 'foo', None, self.dummy_profile)