Re: [ABRT PATCH] - analyze-ccpp don't suid to abrt when run as root, related rhbz#759443

2013-03-06 Thread Jiri Moskovcak
On 03/04/2013 12:54 PM, Jakub Filak wrote: I thought you are the one who is against commits which modify the spec file and sources :) On Monday, March 04, 2013 10:55:52 AM Jiri Moskovcak wrote: Signed-off-by: Jiri Moskovcak jmosk...@redhat.com --- abrt.spec.in

[LIBREPORT PATCH v2] - don't suid before running yum related to rhbz#759443

2013-03-06 Thread Jiri Moskovcak
- if run with root privileges, the debuginfo install script is not suided to abrt, but the installed debuginfo files has to be owned by abrt:abrt, so they can be removed by abrt (e.d. when trimming old files) and that is done using the ensure_abrt_uid decorator Signed-off-by: Jiri Moskovcak

[LIBREPORT PATCH v2 1/2] - analyze-ccpp don't suid to abrt when run as root, related rhbz#759443

2013-03-06 Thread Jiri Moskovcak
- in RHEL debuginfo is in RHN and abrt needs root privileges to be able to access RHN repositories, so if abrt-cli(gui) is run as root a-a-i-di-to-abrt-cache has to be called directly without the suided wraper Signed-off-by: Jiri Moskovcak jmosk...@redhat.com --- src/plugins/Makefile.am

Re: [LIBREPORT PATCH v2] - don't suid before running yum related to rhbz#759443

2013-03-06 Thread Jakub Filak
@@ -36,8 +59,10 @@ def unpack_rpm(package_file_name, files, tmp_dir, destdir, keeprpm, exact_files= except IOError, ex: print _(Can't write to '{0}': {1}).format(unpacked_cpio_path, ex) return RETURN_FAILURE + rpm2cpio = Popen([rpm2cpio, package_full_path],

Re: [LIBREPORT PATCH v2] - don't suid before running yum related to rhbz#759443

2013-03-06 Thread Jakub Filak
It doesn't download debuginfo under root at all: [root@dhcp-25-54 ccpp-2013-03-06-13:52:30-27833]# abrt-cli report /var/tmp/abrt/ccpp-2013-03-06-13:52:30-27833 Analyzing coredump 'coredump' Coredump references 3 debuginfo files, 1 of them are not installed Setting up yum repositories Looking for

Re: [LIBREPORT PATCH v2] - don't suid before running yum related to rhbz#759443

2013-03-06 Thread Jakub Filak
On Wednesday, March 06, 2013 12:55:20 PM Jiri Moskovcak wrote: +def ensure_abrt_uid(fn): +import pwd +current_uid = os.getuid() +current_gid = os.getgid() +abrt = pwd.getpwnam(abrt) + +# if we're are already running as abrt, don't do anything +if abrt.pw_uid ==