nscurl returns exit status code of 0 on failures

Originator:noir.na
Number:rdar://28266796 Date Originated:9/12/2016
Status:Duplicate Resolved:
Product:OS X Product Version:10.11.6
Classification:Bug Reproducible:Always
 
Summary:
When running the nscurl command in any capacity, if an error occurs, nscurl returns an exit status code of 0.

Steps to Reproduce:
1. Launch a Terminal window.
2. Run the command: nscurl —ats-diagnostics example.org
3. Run the command: echo $?

Expected Results:
Because the URL passed to nscurl was invalid (didn’t have http://), and nscurl reports an error to the user, nscurl should exit with a non-zero status code.

Actual Results:
nscurl threw an error, and exited with a status code of 0.

Regression:
Only tested on OS X 10.11.6 with Terminal version 2.6.1.

Notes:
It is standard for bash commands to use exit codes to report whether they were able to run successfully or not. This is especially important for scripting so that a parent script can check the exit code of an executed command, and return meaningful feedback to the user in response. For nscurl I would expect any non-successful execution to return a non-zero status, even if it’s always 1.
http://tldp.org/LDP/abs/html/exitcodes.html

Comments

Duplicate of 22138691 (Open)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!