Skip to content

Commit 956e73f

Browse files
committed
server config BUGFIX proper call-home config access
Fixes #1686
1 parent c3ca3e9 commit 956e73f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/server_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ nc_server_config_get_private_key_type(const char *format)
474474

475475
#endif /* NC_ENABLED_SSH_TLS */
476476

477-
/* gets the ch_client struct based on node's location in the YANG data tree and locks it for reading */
477+
/* gets the ch_client struct based on node's location in the YANG data tree and locks it for writing, it is being modified */
478478
static int
479479
nc_server_config_get_ch_client_with_lock(const struct lyd_node *node, struct nc_ch_client **ch_client)
480480
{
@@ -489,7 +489,7 @@ nc_server_config_get_ch_client_with_lock(const struct lyd_node *node, struct nc_
489489
}
490490

491491
/* LOCK */
492-
pthread_rwlock_rdlock(&server_opts.ch_client_lock);
492+
pthread_rwlock_wrlock(&server_opts.ch_client_lock);
493493
for (i = 0; i < server_opts.ch_client_count; i++) {
494494
if (!strcmp(server_opts.ch_clients[i].name, name)) {
495495
/* LOCK */

0 commit comments

Comments
 (0)