2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 18:42:29 +00:00

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.
This commit is contained in:
Jarrod Johnson
2025-04-25 08:57:50 -04:00
parent b4ef1b484a
commit 0bdcaecf82

View File

@@ -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(