p!ranha?
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/server/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /lib/python2.7/site-packages/firewall/server/server.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 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/>.
#
# signal handling and run_server derived from setroubleshoot
# Copyright (C) 2006,2007,2008,2009 Red Hat, Inc.
# Authors:
#   John Dennis <jdennis@redhat.com>
#   Thomas Liu  <tliu@redhat.com>
#   Dan Walsh <dwalsh@redhat.com>

__all__ = [ "run_server" ]

import sys
import signal

# force use of pygobject3 in python-slip
from gi.repository import GObject, GLib
sys.modules['gobject'] = GObject

import dbus
import dbus.service
import dbus.mainloop.glib
import slip.dbus

from firewall import config
from firewall.core.logger import log
from firewall.server.firewalld import FirewallD

############################################################################
#
# signal handlers
#
############################################################################

def sighup(service):
    service.reload()
    return True

def sigterm(mainloop):
    mainloop.quit()

############################################################################
#
# run_server function
#
############################################################################

def run_server(debug_gc=False):
    """ Main function for firewall server. Handles D-Bus and GLib mainloop.
    """
    service = None
    if debug_gc:
        from pprint import pformat
        import gc
        gc.enable()
        gc.set_debug(gc.DEBUG_LEAK)

        gc_timeout = 10
        def gc_collect():
            gc.collect()
            if len(gc.garbage) > 0:
                print("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
                      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n")
                print("GARBAGE OBJECTS (%d):\n" % len(gc.garbage))
                for x in gc.garbage:
                    print(type(x), "\n  ",)
                    print(pformat(x))
                print("\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
                      "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n")
            GLib.timeout_add_seconds(gc_timeout, gc_collect)

    try:
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
        bus = dbus.SystemBus()
        name = dbus.service.BusName(config.dbus.DBUS_INTERFACE, bus=bus)
        service = FirewallD(name, config.dbus.DBUS_PATH)

        mainloop = GLib.MainLoop()
        slip.dbus.service.set_mainloop(mainloop)
        if debug_gc:
            GLib.timeout_add_seconds(gc_timeout, gc_collect)

        # use unix_signal_add if available, else unix_signal_add_full
        if hasattr(GLib, 'unix_signal_add'):
            unix_signal_add = GLib.unix_signal_add
        else:
            unix_signal_add = GLib.unix_signal_add_full

        unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGHUP,
                        sighup, service)
        unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGTERM,
                        sigterm, mainloop)

        mainloop.run()

    except KeyboardInterrupt:
        log.debug1("Stopping..")

    except SystemExit:
        log.error("Raising SystemExit in run_server")

    except Exception as e:
        log.error("Exception %s: %s", e.__class__.__name__, str(e))

    if service:
        service.stop()
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
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.144 KB
April 28 2021 13:31:13
0 / 0
0644
__init__.pyo
0.144 KB
April 28 2021 13:31:13
0 / 0
0644
config.py
60.636 KB
April 28 2021 13:31:12
0 / 0
0644
config.pyc
48.08 KB
April 28 2021 13:31:13
0 / 0
0644
config.pyo
48.08 KB
April 28 2021 13:31:13
0 / 0
0644
config_helper.py
17.135 KB
April 28 2021 13:31:12
0 / 0
0644
config_helper.pyc
15.447 KB
April 28 2021 13:31:13
0 / 0
0644
config_helper.pyo
15.447 KB
April 28 2021 13:31:13
0 / 0
0644
config_icmptype.py
14.581 KB
April 28 2021 13:31:12
0 / 0
0644
config_icmptype.pyc
12.938 KB
April 28 2021 13:31:13
0 / 0
0644
config_icmptype.pyo
12.938 KB
April 28 2021 13:31:13
0 / 0
0644
config_ipset.py
17.985 KB
April 28 2021 13:31:12
0 / 0
0644
config_ipset.pyc
15.889 KB
April 28 2021 13:31:13
0 / 0
0644
config_ipset.pyo
15.889 KB
April 28 2021 13:31:13
0 / 0
0644
config_service.py
26.19 KB
April 28 2021 13:31:12
0 / 0
0644
config_service.pyc
22.858 KB
April 28 2021 13:31:13
0 / 0
0644
config_service.pyo
22.858 KB
April 28 2021 13:31:13
0 / 0
0644
config_zone.py
41.801 KB
April 28 2021 13:31:12
0 / 0
0644
config_zone.pyc
36.549 KB
April 28 2021 13:31:13
0 / 0
0644
config_zone.pyo
36.549 KB
April 28 2021 13:31:13
0 / 0
0644
decorators.py
2.942 KB
April 28 2021 13:31:12
0 / 0
0644
decorators.pyc
2.588 KB
April 28 2021 13:31:13
0 / 0
0644
decorators.pyo
2.588 KB
April 28 2021 13:31:13
0 / 0
0644
firewalld.py
107.226 KB
April 28 2021 13:31:12
0 / 0
0644
firewalld.pyc
85.283 KB
April 28 2021 13:31:13
0 / 0
0644
firewalld.pyo
85.283 KB
April 28 2021 13:31:13
0 / 0
0644
server.py
3.743 KB
April 28 2021 13:31:12
0 / 0
0644
server.pyc
3.02 KB
April 28 2021 13:31:13
0 / 0
0644
server.pyo
3.02 KB
April 28 2021 13:31:13
0 / 0
0644