-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quit testssl.sh on all command line errors #1871
Conversation
When working on this PR I noticed that the |
e6acf7f
to
8ce04ff
Compare
Argh. Sorry, David, to let this hang for a longer time. It seems my comment I thought to have posted wasn't. My point was that (besides honoring your work) it is not clear to me whether this PR does always send a signal to the parent when one host has a problem -- independent on whether the output is in one file or multiple, see my comment #1844 (comment) . If I don't miss anything we maybe should not default to this behavior. Maybe a cmdline flag would do good here like ~ |
8ce04ff
to
df1d5d4
Compare
If you don't think this PR makes sense, then it's fine to just close it. However, at the moment testssl.sh's behavior is inconsistent with respect to command line errors. For example, if the file provided to the
then an error message will be printed for the second line, but the tests for the other two lines will run. On the other hand, if the file provided to the
then testssl.sh will stop as soon as the second line is parsed. The third line is never run, and in parallel mode the test from the first line is stopped before it completes. The difference is that |
ok, thanks for your heads up. |
df1d5d4
to
104ae34
Compare
588a216
to
71a48b8
Compare
f7edb3d
to
9669da4
Compare
9669da4
to
c0cb5e6
Compare
c0cb5e6
to
18c90ce
Compare
8ec0eb4
to
af7b05e
Compare
de39516
to
8eee4cc
Compare
43925bd
to
f910c31
Compare
c7bfde8
to
11328fa
Compare
8a9239c
to
32383e6
Compare
32383e6
to
8df94ba
Compare
c10cf2a
to
ccd9fe0
Compare
4753687
to
bb9ee99
Compare
ded28c1
to
e6b0655
Compare
e6b0655
to
6868593
Compare
6868593
to
2fdd804
Compare
af5f7d0
to
761ad3b
Compare
6ad3e67
to
4723835
Compare
4723835
to
29e96c6
Compare
a4888d5
to
bc5d192
Compare
bc5d192
to
26fcb44
Compare
Is the rebasing automated? Is there a blocker to merging /resolving this? Just curious as I regularly get notifications from the activity, but it's unclear what the status is? Looks like the decision was to opt-in to this added logic via an option? But there doesn't seem to be any activity towards that. |
Yeah, that one is on me, sorry. I had some concerns in the beginning but as time passed by I forgot what it was and wasn't able to put this fwd in my queue. That will be solved for release, |
As suggested in drwetter#1844, this commit changes testssl.sh so that the parent process quits immediately if there is an error in the command line for one of the child processes. Currently, a signal is sent to the parent process to quit if the child process encounters an error and calls help(), but sometimes parse_cmd_line() just prints an error message and calls fatal() rather than help(), in which case the parent process does not stop. This commit addresses the issue by creating a new function, fatal_cmd_line(), which is almost the same as fatal(), but additionally sends a signal to the parent indicating that the parent should stop. This commit also changes calls to fatal() to calls to fatal_cmd_line() if json_header(), csv_header(), html_header(), or prepare_logging() encounter a problem. The same is done if prettyprint_local() with the command-line option provided for it. There may be other places in which it would be appropriate to call fatal_cmd_line() rather than fatal() (e.g., in parse_hn_port() or check_proxy()), but those changes are not made in this commit.
26fcb44
to
e867e53
Compare
Thanks, David. Sorry to keep this pending for a long time. |
As suggested in #1844, this PR changes testssl.sh so that the parent process quits immediately if there is an error in the command line for one of the child processes.
Currently, a signal is sent to the parent process to quit if the child process encounters an error and calls help(). But sometimes parse_cmd_line() just prints an error message and calls fatal() rather than help(), in which case the parent process does not stop. This PR addresses the issue by creating a new function, fatal_cmd_line(), which is almost the same as fatal(), but additionally sends a signal to the parent indicating that the parent should stop. This PR also changes calls to fatal() to calls to fatal_cmd_line() if json_header(), csv_header(), html_header(), or prepare_logging() encounter a problem. The same is done if prettyprint_local() with the command-line option provided for it.
There may be other places in which it would be appropriate to call fatal_cmd_line() rather than fatal() (e.g., in parse_hn_port() or check_proxy()), but those changes are not made in this PR.
Another issue that this PR addresses is that sometimes when parse_cmd_line() prints an error messsage and then calls help() the error message is send to stderr and other times it is sent to stdout. This PR sends all of these error messages to stderr.