#949: abrt-cli can't run $EDITOR requested for data review
-----------------------+------------------------------
Reporter: jfilak | Owner: crash-catcher@…
Type: defect | Status: new
Priority: major | Milestone:
Component: libreport | Version:
Keywords: | Blocked By:
Blocking: |
-----------------------+------------------------------
Steps to reporduce:
{{{
abrt-cli report $DUMP_DIR
}}}
This doesn't help much:
{{{
diff --git a/src/cli/run-command.c b/src/cli/run-command.c
index ee74566..0dacdf4 100644
--- a/src/cli/run-command.c
+++ b/src/cli/run-command.c
@@ -34,6 +34,17 @@ static pid_t start_command(char **argv)
}
if (pid == 0)
{
+ close(0);
+ if (open("/dev/tty", O_RDWR) < 0)
+ _exit(127); /* 127 = DIE */
+ /* do we want that if we're in a script and have no controlling tty?
+ *
+ * YES, they can always call report-cli -y from script and it should
not
+ * try to open an editor
+ */
+ xdup2(0, 1);
+ xdup2(0, 2);
+
/* Child */
execvp(argv[0], argv);
/* Better to use _exit (not exit) after vfork:
}}}
- editor is started on background with the patch
--
Ticket URL: <
https://fedorahosted.org/abrt/ticket/949>
Automatic Bug Reporting Tool - ABRT <
http://fedorahoted.org/abrt/>
Automatic bug reporting tool