]> 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)
committerOndřej Surý <ondrej@isc.org>
Thu, 1 Oct 2020 14:44:43 +0000 (16:44 +0200)
"showzone" and "tsig-list" both used exclusive mode unnecessarily;
changing this will simplify future refactoring a bit.

(cherry picked from commit 002c328437e7dbc59bbbc23d5bfea5bd6150bdc9)

bin/named/server.c

index 8077161ab4f809d665f32a1b19a5c71550ad7b38..ee0886ad0b1bab83d82cf9916af825bce2b1fc0f 100644 (file)
@@ -12169,12 +12169,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))
        {
@@ -12183,7 +12181,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);
@@ -12191,11 +12188,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."));
@@ -14244,7 +14239,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 */
@@ -14269,10 +14263,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",
@@ -14331,9 +14321,6 @@ cleanup:
        if (isc_buffer_usedlength(*text) > 0) {
                (void)putnull(text);
        }
-       if (exclusive) {
-               isc_task_endexclusive(server->task);
-       }
 
        return (result);
 }