[ABRT PATCH v2] fix debuginfo installer expecting user input from a pipe - closes #696
Petr Kubat
pkubat at redhat.com
Wed Sep 11 12:19:48 UTC 2013
The debuginfo installer currently expects both build-ids and user input from a
pipe with analaze-core, when run from an UI.
We need to change it so that it passes the build-ids through a temporary file
and only uses stdin to communicate with the user.
Also makes the output file from analyze-core readable for others.
Signed-off-by: Petr Kubat <pkubat at redhat.com>
---
src/plugins/abrt-action-analyze-ccpp-local | 5 +++--
src/plugins/abrt-action-analyze-core | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/plugins/abrt-action-analyze-ccpp-local b/src/plugins/abrt-action-analyze-ccpp-local
index 0b02684..ef0976e 100755
--- a/src/plugins/abrt-action-analyze-ccpp-local
+++ b/src/plugins/abrt-action-analyze-ccpp-local
@@ -24,10 +24,11 @@ if $INSTALL_DI; then
# debuginfo install fail even for root.
# Therefore, if we are root, we don't use the wrapper.
if [ x"`id -u`" = x"0" ]; then
- abrt-action-analyze-core --core=coredump | abrt-action-install-debuginfo --ids=- --size_mb=4096
+ abrt-action-analyze-core --core=coredump -o build_ids && abrt-action-install-debuginfo --size_mb=4096
else
- abrt-action-analyze-core --core=coredump | /usr/libexec/abrt-action-install-debuginfo-to-abrt-cache --ids=- --size_mb=4096
+ abrt-action-analyze-core --core=coredump -o build_ids && /usr/libexec/abrt-action-install-debuginfo-to-abrt-cache --size_mb=4096
fi
+ rm -f build_ids
fi
if [ $? = 0 ]; then
diff --git a/src/plugins/abrt-action-analyze-core b/src/plugins/abrt-action-analyze-core
index dc1eee2..806cc26 100644
--- a/src/plugins/abrt-action-analyze-core
+++ b/src/plugins/abrt-action-analyze-core
@@ -171,12 +171,15 @@ if __name__ == "__main__":
# when we are definitely going to write something to it
outfile = sys.stdout
outname = opt_o
+ # Make sure the file is readable for all
+ oldmask = os.umask(0002)
for bid in b_ids:
if outname:
outfile = xopen(outname, "w")
outname = None
outfile.write("%s\n" % bid)
outfile.close()
+ os.umask(oldmask)
except IOError, e:
if not opt_o:
opt_o = "<stdout>"
--
1.7.11.7
More information about the Crash-catcher
mailing list