[PATCH 21/35] abrt-python: fix list_all to return meaningful results
Richard Marko
rmarko at redhat.com
Mon May 13 11:05:30 UTC 2013
Signed-off-by: Richard Marko <rmarko at redhat.com>
---
src/python-problem/problem/proxies.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/python-problem/problem/proxies.py b/src/python-problem/problem/proxies.py
index 50f762f..8a85d25 100644
--- a/src/python-problem/problem/proxies.py
+++ b/src/python-problem/problem/proxies.py
@@ -173,20 +173,25 @@ class FsProxy(object):
ddir.delete()
return True
- def list(self):
+ def list(self, _all=False):
for dir_entry in os.listdir(self.directory):
dump_dir = os.path.join(self.directory, dir_entry)
if not os.path.isdir(dump_dir) or not os.access(dump_dir, os.R_OK):
continue
+ uid = os.getuid()
+ if not _all and os.stat(dump_dir).st_uid != uid:
+ continue
+
ddir = report.dd_opendir(dump_dir)
if ddir:
ddir.close()
yield dump_dir
- def list_all(self, *args):
- return self.list(*args)
+ def list_all(self, *args, **kwargs):
+ kwargs.update(dict(_all=True))
+ return self.list(*args, **kwargs)
def get_proxy():
try:
--
1.8.1.4
More information about the Crash-catcher
mailing list