diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-06-30 13:58:48 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-06-30 13:58:48 +0200 |
| commit | d4f6958f1d4785e1fd9011a6694255f6b64d75b4 (patch) | |
| tree | 76b3901afeeac3cc9c58bfbc3c08bf8d9d69da27 /src | |
| parent | ffcb84545ed8b0d61707ba5787d299ae691eaf10 (diff) | |
| download | abrt-d4f6958f1d4785e1fd9011a6694255f6b64d75b4.tar.gz abrt-d4f6958f1d4785e1fd9011a6694255f6b64d75b4.tar.xz abrt-d4f6958f1d4785e1fd9011a6694255f6b64d75b4.zip | |
Fixed python hook to work with new DebugDump API
Diffstat (limited to 'src')
| -rw-r--r-- | src/Hooks/Makefile.am | 5 | ||||
| -rw-r--r-- | src/Hooks/abrt_exception_handler.py.in | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am index b3ca576..d914941 100644 --- a/src/Hooks/Makefile.am +++ b/src/Hooks/Makefile.am @@ -8,7 +8,6 @@ hookCCpp_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../../lib/Utils \ -DVAR_RUN=\"$(VAR_RUN)\" python_PYTHON = sitecustomize.py abrt_exception_handler.py - EXTRA_DIST = abrt_exception_handler.py.in pyhookconfdir = $(CONF_DIR) @@ -16,5 +15,9 @@ dist_pyhookconf_DATA = pyhook.conf CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc)) +abrt_exception_handler.py: + sed s,@DEBUG_DUMP_DIR@,$(DEBUG_DUMPS_DIR),g abrt_exception_handler.py.in > abrt_exception_handler.py + +# RPM fix: we need to regenerate abrt_exception_handler.py, because it has the default ddir install-data-local: sed s,@DEBUG_DUMP_DIR@,$(DEBUG_DUMPS_DIR),g abrt_exception_handler.py.in > abrt_exception_handler.py diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index 689b5e0..a5a442e 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -114,7 +114,7 @@ def write_dump(pid, tb_uuid, tb): dd = ABRTUtils.CDebugDump() try: #os.mkdir(dir_name) - dd.Create(dir_name) + dd.Create(dir_name, str(os.getuid())) except Exception, e: syslog.syslog("abrt: Cannot create dir %s" % dir_name) return @@ -261,10 +261,8 @@ def installExceptionHandler(debug = 1): version - the version of the application debug - show the full traceback (with "Save to file" in GUI) """ - # FIXME: only root can write ddump :( - if os.getuid() == 0: - sys.excepthook = lambda etype, value, tb: \ - handleMyException((etype, value, tb)) + sys.excepthook = lambda etype, value, tb: \ + handleMyException((etype, value, tb)) if __name__ == '__main__': def _exception_function(): |
