Discussion:
[ABRT PATCH] fix debuginfo installer expecting user input from a pipe - closes #696
Petr Kubat
2013-09-10 12:57:01 UTC
Permalink
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.

Signed-off-by: Petr Kubat <pkubat-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
src/plugins/abrt-action-analyze-ccpp-local | 5 +++--
1 file changed, 3 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
--
1.8.3.1
Jakub Filak
2013-09-11 11:17:20 UTC
Permalink
According to commit b0d6d3dd99417a46e6ba641fef99235e78ead4d1 we should
modify abrt-action-analyze-core to create build_ids file with
umask(0002) or at least with read permission for others because it is
necessary to successfully
run /usr/libexec/abrt-action-install-debuginfo-to-abrt-cache which has
EUID="abrt's uid" and EGID="abrt's gid"
Post by Petr Kubat
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.
---
src/plugins/abrt-action-analyze-ccpp-local | 5 +++--
1 file changed, 3 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
Petr Kubat
2013-09-11 12:19:48 UTC
Permalink
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-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
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
Jakub Filak
2013-09-11 13:07:43 UTC
Permalink
Pushed. Thank you!

Loading...