Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /lib64/python3.9/site-packages/setools/diff/
Upload File :
Current File : //lib64/python3.9/site-packages/setools/diff/polcap.py

# Copyright 2016, Tresys Technology, LLC
#
# SPDX-License-Identifier: LGPL-2.1-only
#
from .descriptors import DiffResultDescriptor
from .difference import Difference, SymbolWrapper


class PolCapsDifference(Difference):

    """Determine the difference in polcaps between two policies."""

    added_polcaps = DiffResultDescriptor("diff_polcaps")
    removed_polcaps = DiffResultDescriptor("diff_polcaps")

    def diff_polcaps(self) -> None:
        """Generate the difference in polcaps between the policies."""

        self.log.info("Generating policy cap differences from {0.left_policy} to {0.right_policy}".
                      format(self))

        self.added_polcaps, self.removed_polcaps, _ = self._set_diff(
            (SymbolWrapper(n) for n in self.left_policy.polcaps()),
            (SymbolWrapper(n) for n in self.right_policy.polcaps()))

    #
    # Internal functions
    #
    def _reset_diff(self) -> None:
        """Reset diff results on policy changes."""
        self.log.debug("Resetting policy capability differences")
        self.added_polcaps = None
        self.removed_polcaps = None

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat