mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 11:09:59 -04:00
Fix a segfault when running nslookup (#38548)
(cherry picked from commitdb93c0def5) (cherry picked from commit9b56539c01) Conflicts: lib/isc/app_api.c lib/isc/win32/libisc.def.in
This commit is contained in:
parent
3a77b9658c
commit
1040bbb55a
8 changed files with 42 additions and 4 deletions
4
CHANGES
4
CHANGES
|
|
@ -1,3 +1,7 @@
|
|||
4070. [bug] Fix a segfault in nslookup in a query such as
|
||||
"nslookup isc.org AMS.SNS-PB.ISC.ORG -all".
|
||||
[RT #38548]
|
||||
|
||||
4069. [doc] Reorganize options in the nsupdate man page.
|
||||
[RT #38516]
|
||||
|
||||
|
|
|
|||
|
|
@ -3682,10 +3682,14 @@ isc_result_t
|
|||
get_address(char *host, in_port_t myport, isc_sockaddr_t *sockaddr) {
|
||||
int count;
|
||||
isc_result_t result;
|
||||
isc_boolean_t is_running;
|
||||
|
||||
isc_app_block();
|
||||
is_running = isc_app_isrunning();
|
||||
if (is_running)
|
||||
isc_app_block();
|
||||
result = bind9_getaddresses(host, myport, sockaddr, 1, &count);
|
||||
isc_app_unblock();
|
||||
if (is_running)
|
||||
isc_app_unblock();
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ version(void) {
|
|||
|
||||
static void
|
||||
setoption(char *opt) {
|
||||
if (strncasecmp(opt, "all", 4) == 0) {
|
||||
if (strncasecmp(opt, "all", 3) == 0) {
|
||||
show_settings(ISC_TRUE, ISC_FALSE);
|
||||
} else if (strncasecmp(opt, "class=", 6) == 0) {
|
||||
if (testclass(&opt[6]))
|
||||
|
|
|
|||
|
|
@ -203,6 +203,16 @@ isc_app_run(void);
|
|||
*\li ISC_R_RELOAD Reload has been requested.
|
||||
*/
|
||||
|
||||
isc_boolean_t
|
||||
isc_app_isrunning(void);
|
||||
/*!<
|
||||
* \brief Return if the ISC library application is running.
|
||||
*
|
||||
* Returns:
|
||||
*\li ISC_TRUE App is running.
|
||||
*\li ISC_FALSE App is not running.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_app_ctxshutdown(isc_appctx_t *ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#define isc_app_ctxstart isc__app_ctxstart
|
||||
#define isc_app_onrun isc__app_onrun
|
||||
#define isc_app_run isc__app_run
|
||||
#define isc_app_isrunning isc__app_isrunning
|
||||
#define isc_app_ctxrun isc__app_ctxrun
|
||||
#define isc_app_shutdown isc__app_shutdown
|
||||
#define isc_app_ctxfinish isc__app_ctxfinish
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ ISC_APPFUNC_SCOPE isc_result_t isc__app_onrun(isc_mem_t *mctx,
|
|||
void *arg);
|
||||
ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxrun(isc_appctx_t *ctx);
|
||||
ISC_APPFUNC_SCOPE isc_result_t isc__app_run(void);
|
||||
ISC_APPFUNC_SCOPE isc_boolean_t isc__app_isrunning(void);
|
||||
ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxshutdown(isc_appctx_t *ctx);
|
||||
ISC_APPFUNC_SCOPE isc_result_t isc__app_shutdown(void);
|
||||
ISC_APPFUNC_SCOPE isc_result_t isc__app_reload(void);
|
||||
|
|
@ -145,6 +146,7 @@ typedef struct isc__appctx {
|
|||
} isc__appctx_t;
|
||||
|
||||
static isc__appctx_t isc_g_appctx;
|
||||
static isc_boolean_t is_running = ISC_FALSE;
|
||||
|
||||
static struct {
|
||||
isc_appmethods_t methods;
|
||||
|
|
@ -728,7 +730,18 @@ isc__app_ctxrun(isc_appctx_t *ctx0) {
|
|||
|
||||
ISC_APPFUNC_SCOPE isc_result_t
|
||||
isc__app_run(void) {
|
||||
return (isc__app_ctxrun((isc_appctx_t *)&isc_g_appctx));
|
||||
isc_result_t result;
|
||||
|
||||
is_running = ISC_TRUE;
|
||||
result = isc__app_ctxrun((isc_appctx_t *)&isc_g_appctx);
|
||||
is_running = ISC_FALSE;
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
ISC_APPFUNC_SCOPE isc_boolean_t
|
||||
isc__app_isrunning(void) {
|
||||
return (is_running);
|
||||
}
|
||||
|
||||
ISC_APPFUNC_SCOPE isc_result_t
|
||||
|
|
|
|||
|
|
@ -196,6 +196,11 @@ isc__app_run(void) {
|
|||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
isc__app_isrunning(void) {
|
||||
return (running);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc__app_shutdown(void) {
|
||||
isc_boolean_t want_kill = ISC_TRUE;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ isc___mempool_put
|
|||
isc___socketmgr_maxudp
|
||||
isc__app_block
|
||||
isc__app_finish
|
||||
isc__app_isrunning
|
||||
isc__app_onrun
|
||||
isc__app_reload
|
||||
isc__app_run
|
||||
|
|
|
|||
Loading…
Reference in a new issue