Fix typos

Found by codespell(1) and typos[1].

[1]: https://github.com/crate-ci/typos

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2024-10-01 17:20:57 +02:00
parent 305c8fa49a
commit 8df3dbe112
47 changed files with 56 additions and 56 deletions

View File

@ -103,7 +103,7 @@
This release focused on improving performance and reducing memory usage.
A Cython-based policy representation replaced the
Python/SWIG/static-linked-libsepol implemention. SETools no longer statically
Python/SWIG/static-linked-libsepol implementation. SETools no longer statically
links to libsepol, though it is strongly suggested that users rebuild SETools
after updating libsepol, in case the policy structure changes.

View File

@ -87,7 +87,7 @@ Find differences in mlsvalidatetrans rules.
.IP "--ibendportcon"
Find differences in ibendportcon (InfiniBand endport context) statements.
.IP "--ibpkeycon"
Find differences in ibpkeycon (InfiniBand parition key context) statements.
Find differences in ibpkeycon (InfiniBand partition key context) statements.
.IP "--initialsid"
Find differences in initial SID statements.
.IP "--fs_use"

View File

@ -57,7 +57,7 @@ There is no expanded information for this component.
Print a list of genfscon statements or, if FS_TYPE is provided, print the statement for the named filesystem type.
There is no expanded information for this component.
.IP "--ibpkeycon [PKEY[-PKEY]]"
Print a list of InfiniBand parition key contexts.
Print a list of InfiniBand partition key contexts.
.IP "--ibendportcon [NAME]"
Print a list of InfiniBand endport contexts.
.IP "--initialsid [NAME]"

2
sediff
View File

@ -532,7 +532,7 @@ try:
nm = len(diff.modified_sensitivities)
print(f"Sensitivities ({na} Added, {nr} Removed, {nm} Modified)")
if diff.added_sensitivities and not args.stats:
print(f" Added Sensitivites: {na}")
print(f" Added Sensitivities: {na}")
for sens in sorted(diff.added_sensitivities):
print(f" + {sens}")
if diff.removed_sensitivities and not args.stats:

View File

@ -96,7 +96,7 @@ class CheckerModule(metaclass=CheckRegistry):
def log_ok(self, msg: str) -> None:
"""
Log findings that pass the check. By default these messages are
surpressed unless self.log_passing is True.
suppressed unless self.log_passing is True.
"""
if self.log_passing:
self.output.write(f"P * {msg}\n")

View File

@ -164,7 +164,7 @@ class DomainTransitionAnalysis(query.DirectedGraphAnalysis):
self.subG = self.G.copy()
except NameError:
self.log.critical("NetworkX is not available. This is "
"requried for Domain Transition Analysis.")
"required for Domain Transition Analysis.")
self.log.critical("This is typically in the python3-networkx package.")
raise
@ -690,7 +690,7 @@ class Edge(mixins.NetworkXGraphEdge):
Parameters:
graph The NetworkX graph.
source The source type of the edge.
target The target tyep of the edge.
target The target type of the edge.
Keyword Parameters:
create (T/F) create the edge if it does not exist.

View File

@ -91,7 +91,7 @@ class InfoFlowAnalysis(query.DirectedGraphAnalysis):
self.subG = self.G.copy()
except NameError:
self.log.critical("NetworkX is not available. This is "
"requried for Information Flow Analysis.")
"required for Information Flow Analysis.")
self.log.critical("This is typically in the python3-networkx package.")
raise

View File

@ -120,7 +120,7 @@ cdef class EbitmapIterator(PolicyIterator):
"""
Base class for iterators over hash tables.
Sublcasses must provide their own __next__, which calls this class's __next__
Subclasses must provide their own __next__, which calls this class's __next__
and then uses a factory function to build and return an object from self.curr.
For example:
@ -177,7 +177,7 @@ cdef class HashtabIterator(PolicyIterator):
"""
Base class for iterators over hash tables.
Sublcasses must provide their own __next__, which calls this class's __next__
Subclasses must provide their own __next__, which calls this class's __next__
and then uses a factory function to build and return an object from self.curr.
For example:
@ -243,7 +243,7 @@ cdef class OcontextIterator(PolicyIterator):
"""
Base class for iterators for most in-policy labeling statements, (portcon, nodecon, etc.)
Sublcasses must provide their own __next__, which calls this class's __next__
Subclasses must provide their own __next__, which calls this class's __next__
and then uses a factory function to build and return an object from self.ocon.
For example:

View File

@ -222,7 +222,7 @@ cdef class IoctlSet(frozenset):
def __format__(self, spec):
"""
String formating.
String formatting.
The standard formatting (no specification) will render the
ranges of ioctls, space separated.

View File

@ -23,7 +23,7 @@ class PolicyQuery(ABC):
# keys are sorted in reverse order so regex settings
# are set before the criteria, e.g. name_regex
# is set before name. This ensures correct behavior
# since the criteria descriptors are sensitve to
# since the criteria descriptors are sensitive to
# regex settings.
for name in sorted(kwargs.keys(), reverse=True):
attr = getattr(self, name, None) # None is not callable

View File

@ -13,7 +13,7 @@ class CommonQueryTab(tab.TableResultTabWidget[setools.CommonQuery, setools.Commo
"""A common permission set query."""
section = tab.AnalysisSection.Components
tab_title = "Common Permision Sets"
tab_title = "Common Permission Sets"
mlsonly = False
def __init__(self, policy: setools.SELinuxPolicy, /, *,

View File

@ -88,7 +88,7 @@ if __name__ == '__main__':
layout.addWidget(widget2)
layout.addWidget(widget3)
window.setToolTip("test tooltip")
window.setWhatsThis("test whats this")
window.setWhatsThis("test what's this")
mw.setCentralWidget(window)
mw.resize(window.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -54,7 +54,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = BoundsRuleType("Test default ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -50,7 +50,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = ComboEnumWidget("Test radio enum", q, "radioattrname", local_enum_class, parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -47,7 +47,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = CommonName("Test Common", q, "name", parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -51,7 +51,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = ConstrainType("Test constrain ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -143,7 +143,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = ContextMatch("Test Context Match", q, parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -55,7 +55,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = DefaultRuleType("Test default ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -85,7 +85,7 @@ if __name__ == '__main__':
widget1 = DefaultValues("Test default values", q1, "default", "default_range", parent=window)
layout.addWidget(widget1)
window.setToolTip("test tooltip")
window.setWhatsThis("test whats this")
window.setWhatsThis("test what's this")
mw.setCentralWidget(window)
mw.resize(window.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -52,7 +52,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = FSUseRuletype("Test fs_use_* ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -127,7 +127,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = IB_EndPortName("Test endport", q, "port", parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -21,7 +21,7 @@ __all__ = ("IP_NetworkName",)
class IP_NetworkName(NameWidget):
"""
Base classs for widgets providing a QLineEdit that saves the input to the attributes
Base class for widgets providing a QLineEdit that saves the input to the attributes
of the specified query. This supports inputs of IP networks, IPv4 or IPv6.
"""

View File

@ -84,7 +84,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = IP_PortName("Test Range", q, "default", enable_range_opts=True, parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -76,7 +76,7 @@ class ListWidget(CriteriaWidget):
self.criteria_any.setChecked(not any((EQUAL_DEFAULT_CHECKED, SUBSET_DEFAULT_CHECKED)))
self.top_layout.addWidget(self.criteria_any, 0, 2, 1, 1)
# the rstrip("_") below is to aviod names like "name__equal"
# the rstrip("_") below is to avoid names like "name__equal"
if enable_equal:
self.criteria_equal = QtWidgets.QRadioButton(self)
self.criteria_equal.setObjectName(f"{self.attrname.rstrip('_')}_equal")

View File

@ -137,7 +137,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = MLSRangeName("Test Range", q, "default", enable_range_opts=True, parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -52,7 +52,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = MLSRuleType("Test MLS ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -68,7 +68,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = ObjClassList("Test Classes", q, "tclass", parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -116,7 +116,7 @@ if __name__ == '__main__':
layout.addWidget(widget1)
layout.addWidget(widget2)
window.setToolTip("test tooltip")
window.setWhatsThis("test whats this")
window.setWhatsThis("test what's this")
mw.setCentralWidget(window)
mw.resize(window.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -112,7 +112,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = RadioEnumWidget("Test radio enum", q, "radioattrname", local_enum_class, parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -13,7 +13,7 @@ from .name import NameWidget
class RangedWidget(NameWidget):
"""
Base classs for widgets providing a QLineEdit that saves the input to the attributes
Base class for widgets providing a QLineEdit that saves the input to the attributes
of the specified query. This supports inputs of ranges, e.g. port ranges and MLS ranges.
"""

View File

@ -53,7 +53,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = RBACRuleType("Test RBAC ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -68,7 +68,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = RoleName("Test Role", q, "source", parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -70,7 +70,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
w = TERuleType("Test TE ruletypes", q, parent=mw)
w.setToolTip("test tooltip")
w.setWhatsThis("test whats this")
w.setWhatsThis("test what's this")
mw.setCentralWidget(w)
mw.resize(w.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -202,7 +202,7 @@ if __name__ == '__main__':
widget = TypeOrAttrName("Test Type/Attribute", q, "source", parent=mw,
enable_regex=True, enable_indirect=True)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -49,7 +49,7 @@ if __name__ == '__main__':
mw = QtWidgets.QMainWindow()
widget = UserName("Test user", q, "user", parent=mw)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
mw.setCentralWidget(widget)
mw.resize(widget.size())
whatsthis = QtWidgets.QWhatsThis.createAction(mw)

View File

@ -110,7 +110,7 @@ transition to occur. These access types form the criteria used by apol
to determine allowed transitions.</p>
<p>The criteria for an allowed dynamic domain transition are as
follows. In the examples below, assume <code>souce_t</code> is the source type
follows. In the examples below, assume <code>source_t</code> is the source type
and, <code>target_t</code> is the target type.</p>
<ol>

View File

@ -263,7 +263,7 @@ if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
widget = ExcludeTypes(a)
widget.setToolTip("test tooltip")
widget.setWhatsThis("test whats this")
widget.setWhatsThis("test what's this")
widget.resize(620, 340)
widget.show()
sys.exit(app.exec())

View File

@ -278,4 +278,4 @@ policies, a path length more than 4 or 5 may be very expensive.</li>
</ol>
<p>Additionally, the analysis can be constrained by number of results. The
<strong>Limit Results</strong> option will stop the analysis if the specified
number of results is reached. There is no idication if there are more results</p>
number of results is reached. There is no indication if there are more results</p>

View File

@ -147,7 +147,7 @@ class PermissionMapEditor(QtWidgets.QDialog):
self.perm_mappings.addWidget(mapping)
self.widgets.append(mapping)
# add horizonal line
# add horizontal line
line = QtWidgets.QFrame(self)
line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)

View File

@ -49,7 +49,7 @@ class UserQueryTab(tab.TableResultTabWidget[setools.UserQuery, setools.User]):
lvl.setToolTip("MLS is disabled in this policy.")
lvl.setWhatsThis(
"""
<p>This MLS lavel for user matching is not available because
<p>This MLS level for user matching is not available because
MLS is disabled in this policy.</p>
""")

View File

@ -67,7 +67,7 @@ class TestAssertRBAC:
assert expected == check.exempt_source
def test_exempt_source_missing(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""Test exempt_source missing role is ignroed."""
"""Test exempt_source missing role is ignored."""
config = {"source": "system",
"exempt_source": "FAIL exempt_src2"}
check = setools.checker.assertrbac.AssertRBAC(

View File

@ -66,7 +66,7 @@ class TestAssertTE:
assert expected == check.exempt_source
def test_source_missing_ignored(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""Test exempt_source missing type is ignroed."""
"""Test exempt_source missing type is ignored."""
config = {"source": "system",
"exempt_source": "FAIL exempt_src2"}
check = setools.checker.assertte.AssertTE(
@ -88,7 +88,7 @@ class TestAssertTE:
assert expected == check.exempt_target
def test_target_missing_ignored(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""Test exempt_target missing type is ignroed."""
"""Test exempt_target missing type is ignored."""
config = {"target": "system",
"exempt_target": "FAIL exempt_tgt2"}
check = setools.checker.assertte.AssertTE(

View File

@ -25,7 +25,7 @@ class TestReadOnlyExecutables:
compiled_policy, "test_all_exec", config)
result = check._collect_executables()
# becasue of unconfined, nonexec is executable
# because of unconfined, nonexec is executable
expected = set(("roexec", "execfile1", "execfile2", "nonexec", "exempt_file"))
assert expected == set(result.keys())

View File

@ -135,7 +135,7 @@ allow trans1 trans2_exec:file execute;
allow trans2 trans2_exec:file entrypoint;
# test 3
# type_transiton and setexec trans2 -> trans3
# type_transition and setexec trans2 -> trans3
# 2 entrypoints
type trans3;
type trans3_exec1;
@ -186,7 +186,7 @@ allow dyntrans101 dyntrans102:process dyntransition;
# test 200
# all transition possiblities dyntrans100 -> bothtrans200
# all transition possibilities dyntrans100 -> bothtrans200
type bothtrans200;
type bothtrans200_exec;
allow dyntrans100 self:process { setexec setcurrent };

View File

@ -19,7 +19,7 @@ class TestCommon:
com = list(compiled_policy.commons()).pop()
assert set(["low_w", "low_r"]) == com.perms, com.perms
def test_statment(self, compiled_policy: setools.SELinuxPolicy) -> None:
def test_statement(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""Common: statement."""
com = list(compiled_policy.commons()).pop()
assert com.statement() in (

View File

@ -19,7 +19,7 @@ class TestObjClass:
cls = compiled_policy.lookup_class("infoflow8")
assert frozenset(["super_w", "super_r"]) == cls.perms, f"{cls.perms}"
def test_statment_wo_common_w_unique(self, compiled_policy: setools.SELinuxPolicy) -> None:
def test_statement_wo_common_w_unique(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""ObjClass: statement, no common."""
cls = compiled_policy.lookup_class("infoflow8")
assert cls.statement() in (
@ -27,7 +27,7 @@ class TestObjClass:
"class infoflow8\n{\n\tsuper_r\n\tsuper_w\n}"), \
cls.statement()
def test_statment_w_common_w_unique(self, compiled_policy: setools.SELinuxPolicy) -> None:
def test_statement_w_common_w_unique(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""ObjClass: statement, with common."""
cls = compiled_policy.lookup_class("infoflow6")
assert cls.statement() in (
@ -35,7 +35,7 @@ class TestObjClass:
"class infoflow6\ninherits com_b\n{\n\tperm2\n\tperm1\n}"), \
cls.statement()
def test_statment_w_common_wo_unique(self, compiled_policy: setools.SELinuxPolicy) -> None:
def test_statement_w_common_wo_unique(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""ObjClass: statement, with common, no class perms."""
cls = compiled_policy.lookup_class("infoflow5")
assert cls.statement() == "class infoflow5\ninherits com_a\n", cls.statement()

View File

@ -13,8 +13,8 @@ import setools
@pytest.mark.obj_args("tests/library/policyrep/selinuxpolicy.conf")
class TestSELinuxPolicy:
def test_open_policy_non_existant(self) -> None:
"""SELinuxPolicy: Non existant policy on open."""
def test_open_policy_non_existent(self) -> None:
"""SELinuxPolicy: Non existent policy on open."""
with pytest.raises(OSError):
setools.SELinuxPolicy("tests/policyrep/DOES_NOT_EXIST")
@ -58,7 +58,7 @@ class TestSELinuxPolicy:
assert compiled_policy.class_count == 7
def test_common_count(self, compiled_policy: setools.SELinuxPolicy) -> None:
"""SELinuxPolicy: common permisison set count"""
"""SELinuxPolicy: common permission set count"""
assert compiled_policy.common_count == 3
def test_conditional_count(self, compiled_policy: setools.SELinuxPolicy) -> None: