Hackfut Security File Manager
Current Path:
/usr/lib64/python2.6/site-packages
usr
/
lib64
/
python2.6
/
site-packages
/
📁
..
📁
Cheetah
📁
Cheetah-2.4.1-py2.6.egg-info
📁
Jinja2-2.2.1-py2.6.egg-info
📁
M2Crypto
📄
M2Crypto-0.20.2-py2.6.egg-info
(1.13 KB)
📁
MySQL_python-1.2.5-py2.6.egg-info
📁
MySQLdb
📁
OpenSSL
📄
PyYAML-3.10-py2.6.egg-info
(1.72 KB)
📄
README
(119 B)
📄
_audit.so
(148.5 KB)
📄
_dbus_bindings.so
(150.42 KB)
📄
_dbus_glib_bindings.so
(8.19 KB)
📄
_mysql.so
(138.11 KB)
📄
_mysql_exceptions.py
(2.3 KB)
📄
_mysql_exceptions.pyc
(4.16 KB)
📄
_semanage.so
(220.1 KB)
📄
_snackmodule.so
(34.67 KB)
📄
_sqlitecache.so
(44.26 KB)
📄
_yaml.so
(181.81 KB)
📄
abrt.pth
(30 B)
📄
abrt_exception_handler.py
(6.91 KB)
📄
abrt_exception_handler.pyc
(4.69 KB)
📄
abrt_exception_handler.pyo
(4.69 KB)
📄
acutilmodule.so
(5.88 KB)
📄
audit.py
(42.34 KB)
📄
audit.pyc
(40.98 KB)
📄
audit.pyo
(40.98 KB)
📄
auparse.so
(47.48 KB)
📁
backports
📁
curl
📄
dmidecode.py
(3.38 KB)
📄
dmidecode.pyc
(2.27 KB)
📄
dmidecode.pyo
(2.27 KB)
📄
dmidecodemod.so
(180.77 KB)
📁
dns
📄
drv_libxml2.py
(14.71 KB)
📄
drv_libxml2.pyc
(11.06 KB)
📄
drv_libxml2.pyo
(11.06 KB)
📄
ethtool-0.6-py2.6.egg-info
(288 B)
📄
ethtool.so
(37.38 KB)
📁
gpgme
📁
gtk-2.0
📄
gudev.so
(25.38 KB)
📄
iwlib-1.0-py2.6.egg-info
(358 B)
📄
iwlib.so
(8.75 KB)
📁
jinja2
📄
libiscsimodule.so
(17.49 KB)
📄
libxml2.py
(331.81 KB)
📄
libxml2.pyc
(434.5 KB)
📄
libxml2.pyo
(434.5 KB)
📄
libxml2mod.a
(552.6 KB)
📄
libxml2mod.la
(1015 B)
📄
libxml2mod.so
(359.35 KB)
📁
lxml
📁
lxml-2.2.3-py2.6.egg-info
📁
meld3
📄
meld3-0.6.7-py2.6.egg-info
(259 B)
📁
modulator
📄
ordereddict-1.2-py2.6.egg-info
(183 B)
📁
policycoreutils
📄
policycoreutils_default_encoding-0.1-py2.6.egg-info
(300 B)
📁
problem
📄
pyOpenSSL-0.13.1-py2.6.egg-info
(582 B)
📄
pycurl-7.19.0-py2.6.egg-info
(366 B)
📄
pycurl.so
(67.88 KB)
📄
pygpgme-0.1-py2.6.egg-info
(836 B)
📄
pygtk.pth
(8 B)
📄
pygtk.py
(2.9 KB)
📄
pygtk.pyc
(2.03 KB)
📄
pygtk.pyo
(1.75 KB)
📁
pylve-2.1-py2.6.egg-info
📄
pylve.so
(19.09 KB)
📁
pynche
📄
python_dmidecode-3.10.15-py2.6.egg-info
(311 B)
📁
report
📁
reportclient
📁
rpm
📁
selinux
📄
semanage.py
(40.46 KB)
📄
semanage.pyc
(51.53 KB)
📄
semanage.pyo
(51.53 KB)
📄
seobject.py
(78.87 KB)
📄
seobject.pyc
(78.09 KB)
📄
seobject.pyo
(78.09 KB)
📁
sepolgen
📁
setools
📄
setools-1.0-py2.6.egg-info
(206 B)
📁
simplejson
📄
simplejson-2.2.0-py2.6.egg-info
(1.37 KB)
📄
snack.py
(29.92 KB)
📄
snack.pyc
(39.8 KB)
📄
snack.pyo
(39.8 KB)
📄
sqlitecachec.py
(2.45 KB)
📄
sqlitecachec.pyc
(2.13 KB)
📄
sqlitecachec.pyo
(2.13 KB)
📁
yaml
📄
yum_metadata_parser-1.1.2-py2.6.egg-info
(213 B)
Editing: abrt_exception_handler.py
#:mode=python: # -*- coding: utf-8 -*- ## Copyright (C) 2001-2005 Red Hat, Inc. ## Copyright (C) 2001-2005 Harald Hoyer <harald@redhat.com> ## Copyright (C) 2009 Jiri Moskovcak <jmoskovc@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, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ Module for the ABRT exception handling hook """ import sys import os def write_dump(tb): if sys.argv[0][0] == "/": executable = os.path.abspath(sys.argv[0]) else: # We don't know the path. # (BTW, we *can't* assume the script is in current directory.) executable = sys.argv[0] # Open ABRT daemon's socket and write data to it try: import socket s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.settimeout(5) try: s.connect("/var/run" + "/abrt/abrt.socket") s.sendall("PUT / HTTP/1.1\r\n\r\n") s.sendall("PID=%s\0" % os.getpid()) s.sendall("EXECUTABLE=%s\0" % executable) s.sendall("ANALYZER=Python\0") s.sendall("TYPE=Python\0") s.sendall("BASENAME=pyhook\0") # This handler puts a short(er) crash descr in 1st line of the backtrace. # Example: # CCMainWindow.py:1:<module>:ZeroDivisionError: integer division or modulo by zero s.sendall("REASON=%s\0" % tb.splitlines()[0]) s.sendall("BACKTRACE=%s\0" % tb) s.shutdown(socket.SHUT_WR) # Read the response and log if there's anything wrong response = "" while True: buf = s.recv(256) if not buf: break response += buf except socket.timeout, ex: import syslog syslog.syslog("communication with ABRT daemon failed: %s" % str(ex)) s.close() parts = response.split() if (len(parts) < 2 or (not parts[0].startswith("HTTP/")) or (not parts[1].isdigit()) or (int(parts[1]) >= 400)): import syslog syslog.syslog("error sending data to ABRT daemon: %s" % response) except Exception, ex: import syslog syslog.syslog("can't communicate with ABRT daemon, is it running? %s" % str(ex)) def conf_enabled(var_name): try: conf = problem.load_plugin_conf_file("python.conf") except: return -1 else: conf.get(var_name, -1) def handleMyException((etype, value, tb)): """ The exception handling function. progname - the name of the application version - the version of the application """ try: # Restore original exception handler sys.excepthook = sys.__excepthook__ # pylint: disable-msg=E1101 import errno # Ignore Ctrl-C # SystemExit rhbz#636913 -> this exception is not an error if etype in [KeyboardInterrupt, SystemExit]: return sys.__excepthook__(etype, value, tb) # Ignore EPIPE: it happens all the time # Testcase: script.py | true, where script.py is: ## #!/usr/bin/python ## import os ## import time ## time.sleep(1) ## os.write(1, "Hello\n") # print "Hello" wouldn't be the same # if etype == IOError or etype == OSError: if value.errno == errno.EPIPE: return sys.__excepthook__(etype, value, tb) import syslog syslog.openlog("abrt") # Ignore interactive Python and similar # Check for first "-" is meant to catch "-c" which appears in this case: ## $ python -c 'import sys; print "argv0 is:%s" % sys.argv[0]' ## argv0 is:-c # Are there other cases when sys.argv[0][0] is "-"? if not sys.argv[0] or sys.argv[0][0] == "-": syslog.syslog("detected unhandled Python exception") raise Exception # Ignore scripts with relative path unless "RequireAbsolutePath = no". # (In this case we can't reliably determine package) syslog.syslog("detected unhandled Python exception in '%s'" % sys.argv[0]) if sys.argv[0][0] != "/": if conf_enabled("RequireAbsolutePath") != 0: raise Exception import traceback elist = traceback.format_exception(etype, value, tb) if tb != None and etype != IndentationError: tblast = traceback.extract_tb(tb, limit=None) if len(tblast): tblast = tblast[len(tblast)-1] extxt = traceback.format_exception_only(etype, value) if tblast and len(tblast) > 3: ll = [] ll.extend(tblast[:3]) ll[0] = os.path.basename(tblast[0]) tblast = ll ntext = "" for t in tblast: ntext += str(t) + ":" text = ntext text += extxt[0] text += "\n" text += "".join(elist) trace = tb while trace.tb_next: trace = trace.tb_next frame = trace.tb_frame text += ("\nLocal variables in innermost frame:\n") try: for (key, val) in frame.f_locals.items(): text += "%s: %s\n" % (key, repr(val)) except: pass else: text = str(value) + "\n" text += "\n" text += "".join(elist) # Send data to the daemon write_dump(text) except: # Silently ignore any error in this hook, # to not interfere with other scripts pass return sys.__excepthook__(etype, value, tb) def installExceptionHandler(): """ Install the exception handling function. """ sys.excepthook = lambda etype, value, tb: handleMyException((etype, value, tb)) # install the exception handler when the abrt_exception_handler # module is imported try: installExceptionHandler() except Exception, e: # TODO: log errors? # OTOH, if abrt is deinstalled uncleanly # and this file (sitecustomize.py) exists but # abrt_exception_handler module does not exist, we probably # don't want to irritate admins... pass if __name__ == '__main__': # test exception raised to show the effect div0 = 1 / 0 # pylint: disable-msg=W0612 sys.exit(0) __author__ = "Harald Hoyer <harald@redhat.com>"
Upload File
Create Folder