mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-29 13:28:19 +00:00
Merge Fix spelling and grammar errors.
I found a few spelling and grammar errors while working on my other merge requests. I figured it'd be wise to separate these fixes from the code changes. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/887 Approved-by: Christian Boltz <apparmor@cboltz.de> Merged-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
commit
df1ca957d6
@ -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()
|
||||
|
@ -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')
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user