mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Remove problematic optimization from gethostfqdn()
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
parent
5d4ed65b83
commit
b66b961fdd
@ -7,12 +7,11 @@ import socket
|
||||
|
||||
|
||||
def gethostfqdn():
|
||||
"""Get the fully qualified domain name of current host from glibc
|
||||
|
||||
:return: FQDN as str
|
||||
"""
|
||||
hostname = socket.gethostname()
|
||||
|
||||
# optional optimization, consider hostname with dot as FQDN
|
||||
if "." in hostname:
|
||||
return hostname
|
||||
|
||||
# this call can never fail except for misconfigured nsswitch.conf
|
||||
# without nss-myhostname provider. The myhostname provider translates
|
||||
# gethostname() to local interfaces.
|
||||
|
Loading…
Reference in New Issue
Block a user