Server IP : 103.169.32.36 / Your IP : 216.73.217.13 Web Server : Apache System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : apache ( 48) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/firewall/ |
Upload File : |
| Current File : /lib/python2.7/site-packages/firewall/errors.py |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2012 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
ALREADY_ENABLED = 11
NOT_ENABLED = 12
COMMAND_FAILED = 13
NO_IPV6_NAT = 14
PANIC_MODE = 15
ZONE_ALREADY_SET = 16
UNKNOWN_INTERFACE = 17
ZONE_CONFLICT = 18
BUILTIN_CHAIN = 19
EBTABLES_NO_REJECT = 20
NOT_OVERLOADABLE = 21
NO_DEFAULTS = 22
BUILTIN_ZONE = 23
BUILTIN_SERVICE = 24
BUILTIN_ICMPTYPE = 25
NAME_CONFLICT = 26
NAME_MISMATCH = 27
PARSE_ERROR = 28
ACCESS_DENIED = 29
UNKNOWN_SOURCE = 30
RT_TO_PERM_FAILED = 31
IPSET_WITH_TIMEOUT = 32
BUILTIN_IPSET = 33
ALREADY_SET = 34
MISSING_IMPORT = 35
DBUS_ERROR = 36
BUILTIN_HELPER = 37
NOT_APPLIED = 38
INVALID_ACTION = 100
INVALID_SERVICE = 101
INVALID_PORT = 102
INVALID_PROTOCOL = 103
INVALID_INTERFACE = 104
INVALID_ADDR = 105
INVALID_FORWARD = 106
INVALID_ICMPTYPE = 107
INVALID_TABLE = 108
INVALID_CHAIN = 109
INVALID_TARGET = 110
INVALID_IPV = 111
INVALID_ZONE = 112
INVALID_PROPERTY = 113
INVALID_VALUE = 114
INVALID_OBJECT = 115
INVALID_NAME = 116
INVALID_FILENAME = 117
INVALID_DIRECTORY = 118
INVALID_TYPE = 119
INVALID_SETTING = 120
INVALID_DESTINATION = 121
INVALID_RULE = 122
INVALID_LIMIT = 123
INVALID_FAMILY = 124
INVALID_LOG_LEVEL = 125
INVALID_AUDIT_TYPE = 126
INVALID_MARK = 127
INVALID_CONTEXT = 128
INVALID_COMMAND = 129
INVALID_USER = 130
INVALID_UID = 131
INVALID_MODULE = 132
INVALID_PASSTHROUGH = 133
INVALID_MAC = 134
INVALID_IPSET = 135
INVALID_ENTRY = 136
INVALID_OPTION = 137
INVALID_HELPER = 138
MISSING_TABLE = 200
MISSING_CHAIN = 201
MISSING_PORT = 202
MISSING_PROTOCOL = 203
MISSING_ADDR = 204
MISSING_NAME = 205
MISSING_SETTING = 206
MISSING_FAMILY = 207
RUNNING_BUT_FAILED = 251
NOT_RUNNING = 252
NOT_AUTHORIZED = 253
UNKNOWN_ERROR = 254
import sys
class FirewallError(Exception):
def __init__(self, code, msg=None):
self.code = code
if msg is not None:
# escape msg if needed
if sys.version < '3':
try:
x = str(msg) # noqa: F841
except UnicodeEncodeError:
msg = unicode(msg).encode("unicode_escape") # noqa: F821
self.msg = msg
def __repr__(self):
return '%s(%r, %r)' % (self.__class__, self.code, self.msg)
def __str__(self):
if self.msg:
return "%s: %s" % (self.errors[self.code], self.msg)
return self.errors[self.code]
def get_code(msg):
if ":" in msg:
idx = msg.index(":")
ecode = msg[:idx]
else:
ecode = msg
try:
code = FirewallError.codes[ecode]
except KeyError:
code = UNKNOWN_ERROR
return code
get_code = staticmethod(get_code)
mod = sys.modules[FirewallError.__module__]
FirewallError.errors = { getattr(mod,varname) : varname
for varname in dir(mod)
if not varname.startswith("_") and \
type(getattr(mod,varname)) == int }
FirewallError.codes = { FirewallError.errors[code] : code
for code in FirewallError.errors }
| N4m3 |
5!z3 |
L45t M0d!f!3d |
0wn3r / Gr0up |
P3Rm!55!0n5 |
0pt!0n5 |
| .. |
-- |
December 21 2023 09:18:24 |
0 / 0 |
0755 |
|
| config |
-- |
December 20 2023 04:52:59 |
0 / 0 |
0755 |
|
| core |
-- |
December 20 2023 04:52:59 |
0 / 0 |
0755 |
|
| server |
-- |
December 20 2023 04:52:59 |
0 / 0 |
0755 |
|
| | | | | |
| __init__.py |
0 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| __init__.pyc |
0.137 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| __init__.pyo |
0.137 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| client.py |
106.958 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| client.pyc |
133.379 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| client.pyo |
133.379 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| command.py |
21.817 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| command.pyc |
18.885 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| command.pyo |
18.885 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| dbus_utils.py |
7.822 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| dbus_utils.pyc |
7.149 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| dbus_utils.pyo |
7.149 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| errors.py |
4.169 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| errors.pyc |
4.599 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| errors.pyo |
4.599 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| functions.py |
14.251 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| functions.pyc |
16.193 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| functions.pyo |
16.193 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| fw_types.py |
2.142 KB |
April 28 2021 13:31:12 |
0 / 0 |
0644 |
|
| fw_types.pyc |
3.036 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|
| fw_types.pyo |
3.036 KB |
April 28 2021 13:31:13 |
0 / 0 |
0644 |
|