From 0bdcaecf82d986afe53a0a38ea3958d87b341d4e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 25 Apr 2025 08:57:50 -0400 Subject: [PATCH] Do not include localhost in syncfiles consideration localhost was added to ssh principals, but should not be used as a candidate in syncfiles. The syncfileclient should already be filtering this possibility, but best to filter it everywhere that makes sense. --- confluent_server/confluent/selfservice.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/selfservice.py b/confluent_server/confluent/selfservice.py index 14c8dd0e..de8eb832 100644 --- a/confluent_server/confluent/selfservice.py +++ b/confluent_server/confluent/selfservice.py @@ -52,8 +52,11 @@ def listdump(input): return retval -def get_extra_names(nodename, cfg, myip=None, preferadjacent=False): - names = set(['127.0.0.1', '::1', 'localhost', 'localhost.localdomain']) +def get_extra_names(nodename, cfg, myip=None, preferadjacent=False, addlocalhost=True): + if addlocalhost: + names = set(['127.0.0.1', '::1', 'localhost', 'localhost.localdomain']) + else: + names = set([]) dnsinfo = cfg.get_node_attributes(nodename, ('dns.*', 'net.*hostname')) dnsinfo = dnsinfo.get(nodename, {}) domain = dnsinfo.get('dns.domain', {}).get('value', None) @@ -528,7 +531,7 @@ def handle_request(env, start_response): return elif env['PATH_INFO'].startswith('/self/remotesyncfiles'): if 'POST' == operation: - pals = get_extra_names(nodename, cfg, myip, preferadjacent=True) + pals = get_extra_names(nodename, cfg, myip, preferadjacent=True, addlocalhost=False) if clientip in pals: pals = [clientip] result = syncfiles.start_syncfiles(