Bug 4202 - nsd-control delzone incorrect exit code on error
nsd-control delzone incorrect exit code on error
Status: RESOLVED FIXED
Product: NSD
Classification: Unclassified
Component: NSD Code
4.1.x
x86_64 Linux
: P5 enhancement
Assigned To: NSD team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-08 21:07 CET by andrew
Modified: 2018-11-19 14:12 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2018-11-08 21:07:17 CET
Hi,

A tiny error handling bug for you! 

`
nsd-control delzone nonexistant.net; echo $?
warning zone nonexistant.net not present
ok
0
`

Error is in remote.c perform_delzone()

`
if(!ssl_printf(ssl, "warning zone %s not present\n", arg))
  return 0;
return 1;
`

should probably be..

`
(void)ssl_printf(ssl, "warning zone %s not present\n", arg);
return 0;

`
Comment 1 Wouter Wijngaards 2018-11-19 14:12:03 CET
Hi Andrew,

Thanks for the report! Fixed it to return 0 there.

Best regards, Wouter