Report information
The Basics
Id:
42011
Status:
resolved
Priority:
Medium/Medium
Queue:

People
Cc:
AdminCc:

BugTracker
Version Fixed:
9.12.0
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
(no value)
Priority:
P2 Normal
Severity:
S2 Normal
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
BIND Utilities
Area:
Other

Dates
Created:Thu, 24 Mar 2016 06:29:39 -0400
Updated:Thu, 23 Nov 2017 01:00:02 -0500
Closed:Thu, 23 Nov 2017 01:00:02 -0500



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

Subject: Reduce use of 'exit()' in 'dig'
In porting "dig" to iOS I've got a few places where use of exit() outside of main() can cause problems. At the moment I just use #define to turn exit() into a no-op, since having the program terminate arbitrarily wouldn't be acceptable for the AppStore, but neither would having it crash if the no-op'd exit() leaves the program in an indeterminate state. 1. In dig's batch mode, if you supply illegal parameters in the input file (e.g. "-y foo") it causes dig to exit, rather than just carry on with the next input line. 2. In arg processing, "-h" calls usage() which in turn calls exit() 3. Numerous calls to fatal(), which also cause an exit() It would be highly preferable if the termination conditions were passed back up the call stack so that the application gets the chance to clean up properly (and perhaps keep running).
On Tue Nov 07 04:56:20 2017, ray wrote: > Please review rt42011_b > > I've made several previously fatal() errors in parsing command line > arguments into non-fatal ones. > > I've also created a hook that show allow the dig for iOS app to > display a popup before any truly fatal() errors cause the application > to quit. Adjusted the code so that Coverity shouldn't complain about unreachable code when build on a non iOS platform. Looks good to go.
To: bind-suggest@isc.org
Subject: Re: [ISC-Bugs #42011] Reduce use of 'exit()' in 'dig'
Date: Tue, 21 Nov 2017 16:52:59 +0000
From: "Ray Bellis" <ray@isc.org>
On 21/11/2017 04:33, Mark Andrews via RT wrote: > Looks good to go. I've pushed some further changes back. Your new 'digexit()' function is still required under iOS, because fatal() is still used in some places. Also, we ended up with TARGET_IPHONE_OS instead of TARGET_OS_IPHONE in places. Ray