mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 13:58:22 +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:
@@ -120,8 +120,8 @@ def gen_file (name, xres, leading1, qual1, rule1, perm1, target1, leading2, qual
|
|||||||
#
|
#
|
||||||
# will conflict
|
# will conflict
|
||||||
#
|
#
|
||||||
# NOTE: conflict tests don't tests leading permissions or using unsafe keywords
|
# 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 coorispondance
|
# It is assumed that there are extra tests to verify 1 to 1 correspondance
|
||||||
def gen_files(name, rule1, rule2, default):
|
def gen_files(name, rule1, rule2, default):
|
||||||
perms = gen_list()
|
perms = gen_list()
|
||||||
|
|
||||||
|
@@ -162,7 +162,7 @@ def follow_apparmor_events(logfile, wait=0):
|
|||||||
'''Follow AppArmor events and yield relevant entries until process stops'''
|
'''Follow AppArmor events and yield relevant entries until process stops'''
|
||||||
|
|
||||||
# If wait was given as argument but was type None (from ArgumentParser)
|
# 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:
|
if not wait:
|
||||||
wait = 0
|
wait = 0
|
||||||
|
|
||||||
@@ -518,7 +518,7 @@ def main():
|
|||||||
os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path=/run/user/{}/bus'.format(os.geteuid())
|
os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path=/run/user/{}/bus'.format(os.geteuid())
|
||||||
|
|
||||||
# Before use, notify2 must be initialized and the DBUS channel
|
# 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().
|
# be executed after the drop_privileges().
|
||||||
notify2.init('AppArmor')
|
notify2.init('AppArmor')
|
||||||
|
|
||||||
|
@@ -1815,7 +1815,7 @@ def parse_profile_data(data, file, do_include, in_preamble):
|
|||||||
load_include(incname, 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
|
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 "}".
|
# 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).
|
# The logic is simple and resembles a "poor man's stack" (with limited/hardcoded height).
|
||||||
if profile:
|
if profile:
|
||||||
|
@@ -219,7 +219,7 @@ class Config(object):
|
|||||||
if os.path.exists(self.input_file):
|
if os.path.exists(self.input_file):
|
||||||
with open_file_read(self.input_file) as f_in:
|
with open_file_read(self.input_file) as f_in:
|
||||||
for line in f_in:
|
for line in f_in:
|
||||||
# If its a section
|
# If it's a section
|
||||||
if line.lstrip().startswith('['):
|
if line.lstrip().startswith('['):
|
||||||
# If any options from preceding section remain write them
|
# If any options from preceding section remain write them
|
||||||
if options:
|
if options:
|
||||||
|
@@ -680,7 +680,7 @@ class AppArmorEasyProfile:
|
|||||||
else: # should not ever reach this
|
else: # should not ever reach this
|
||||||
raise AppArmorException("Could not determine output filename")
|
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('/')))
|
out_fn = os.path.join(dir, re.sub(r'/', '.', out_fn.lstrip('/')))
|
||||||
if os.path.exists(out_fn):
|
if os.path.exists(out_fn):
|
||||||
raise AppArmorException("'%s' already exists" % out_fn)
|
raise AppArmorException("'%s' already exists" % out_fn)
|
||||||
|
@@ -30,7 +30,7 @@ exp = namedtuple('exp', ['comment',
|
|||||||
|
|
||||||
class AliasTest(AATest):
|
class AliasTest(AATest):
|
||||||
def _compare_obj(self, obj, expected):
|
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.allow_keyword)
|
||||||
self.assertEqual(False, obj.audit)
|
self.assertEqual(False, obj.audit)
|
||||||
self.assertEqual(False, obj.deny)
|
self.assertEqual(False, obj.deny)
|
||||||
|
@@ -62,7 +62,7 @@ class TestAdd_profile(AATest):
|
|||||||
|
|
||||||
def testAdd_profileError_2(self):
|
def testAdd_profileError_2(self):
|
||||||
with self.assertRaises(AppArmorBug):
|
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):
|
def testAdd_profileError_list_nonexisting_file(self):
|
||||||
self.pl.add_profile('/etc/apparmor.d/bin.foo', 'foo', None, self.dummy_profile)
|
self.pl.add_profile('/etc/apparmor.d/bin.foo', 'foo', None, self.dummy_profile)
|
||||||
|
Reference in New Issue
Block a user