]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
don't use exclusive mode for rndc commands that don't need it
authorEvan Hunt <each@isc.org>
Wed, 15 Apr 2020 21:37:47 +0000 (14:37 -0700)
committerEvan Hunt <each@isc.org>
Mon, 13 Jul 2020 20:12:33 +0000 (13:12 -0700)
"showzone" and "tsig-list" both used exclusive mode unnecessarily;
changing this will simplify future refactoring a bit.

bin/named/server.c

index 5df22c847608417e526e0578607e19a4b2d030c3..0d3111c024b25cf6cb5ca31bf7914fc859fc940a 100644 (file)
@@ -12086,12 +12086,10 @@ cleanup:
 
 isc_result_t
 named_server_tsiglist(named_server_t *server, isc_buffer_t **text) {
-       isc_result_t result;
+       isc_result_t result = ISC_R_SUCCESS;
        dns_view_t *view;
        unsigned int foundkeys = 0;
 
-       result = isc_task_beginexclusive(server->task);
-       RUNTIME_CHECK(result == ISC_R_SUCCESS);
        for (view = ISC_LIST_HEAD(server->viewlist); view != NULL;
             view = ISC_LIST_NEXT(view, link))
        {
@@ -12100,7 +12098,6 @@ named_server_tsiglist(named_server_t *server, isc_buffer_t **text) {
                                       &foundkeys);
                RWUNLOCK(&view->statickeys->lock, isc_rwlocktype_read);
                if (result != ISC_R_SUCCESS) {
-                       isc_task_endexclusive(server->task);
                        return (result);
                }
                RWLOCK(&view->dynamickeys->lock, isc_rwlocktype_read);
@@ -12108,11 +12105,9 @@ named_server_tsiglist(named_server_t *server, isc_buffer_t **text) {
                                       &foundkeys);
                RWUNLOCK(&view->dynamickeys->lock, isc_rwlocktype_read);
                if (result != ISC_R_SUCCESS) {
-                       isc_task_endexclusive(server->task);
                        return (result);
                }
        }
-       isc_task_endexclusive(server->task);
 
        if (foundkeys == 0) {
                CHECK(putstr(text, "no tsig keys found."));
@@ -14161,7 +14156,6 @@ named_server_showzone(named_server_t *server, isc_lex_t *lex,
        dns_view_t *view = NULL;
        dns_zone_t *zone = NULL;
        ns_cfgctx_t *cfg = NULL;
-       bool exclusive = false;
 #ifdef HAVE_LMDB
        cfg_obj_t *nzconfig = NULL;
 #endif /* HAVE_LMDB */
@@ -14186,10 +14180,6 @@ named_server_showzone(named_server_t *server, isc_lex_t *lex,
                goto cleanup;
        }
 
-       result = isc_task_beginexclusive(server->task);
-       RUNTIME_CHECK(result == ISC_R_SUCCESS);
-       exclusive = true;
-
        if (!added) {
                /* Find the view statement */
                vconfig = find_name_in_list_from_map(cfg->config, "view",
@@ -14248,9 +14238,6 @@ cleanup:
        if (isc_buffer_usedlength(*text) > 0) {
                (void)putnull(text);
        }
-       if (exclusive) {
-               isc_task_endexclusive(server->task);
-       }
 
        return (result);
 }