[PATCH 29/35] abrt-python: pass DD_OPEN_READONLY only if available

Jakub Filak jfilak at redhat.com
Mon May 20 15:06:00 UTC 2013


Please, backport this patch to libreport/rhl6

commit eee49648855904d7e7549c063b7a260dfdb01cce
Author: Richard Marko <rmarko at redhat.com>
Date:   Mon Dec 10 13:21:45 2012 +0100

     report-python: export DD_OPEN_READONLY too


And use DD_OPEN_READONLY in dd_opendir() everywhere where it is needed:
- FsProxy.list()
- FsProxy.get_item()
- ...


On Mon, 13 May 2013, Richard Marko wrote:

> From: Richard Marko <rmarko at fedoraproject.org>
>
> Signed-off-by: Richard Marko <rmarko at fedoraproject.org>
> Signed-off-by: Richard Marko <rmarko at redhat.com>
> ---
> src/python-problem/problem/proxies.py | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/python-problem/problem/proxies.py b/src/python-problem/problem/proxies.py
> index d4b3cfa..c547161 100644
> --- a/src/python-problem/problem/proxies.py
> +++ b/src/python-problem/problem/proxies.py
> @@ -155,13 +155,15 @@ class FsProxy(object):
>     def get_item(self, dump_dir, name):
>         ddir = self._open_ddir(dump_dir)
>
> -        val = ddir.load_text(
> -            name,
> -            report.DD_OPEN_READONLY |
> -            report.DD_FAIL_QUIETLY_EACCES |
> +        flags = (report.DD_FAIL_QUIETLY_EACCES |
>             report.DD_FAIL_QUIETLY_ENOENT |
>             report.DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE)
>
> +        if hasattr(report, 'DD_OPEN_READONLY'):
> +            flags |= report.DD_OPEN_READONLY
> +
> +        val = ddir.load_text(name, flags)
> +
>         ddir.close()
>         return val
>
> -- 
> 1.8.1.4
>
>


More information about the Crash-catcher mailing list