diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index 2f1a4d679..cdfde085a 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -21,6 +21,7 @@ import gssapi import netifaces import os import SSSDConfig +import shutil import socket import sys import tempfile @@ -641,9 +642,9 @@ def configure_krb5_conf( # templating, but that could be changed in the future. template = os.path.join( paths.USR_SHARE_IPA_DIR, - os.path.basename(paths.KRB5_FREEIPA) + ".template") - contents = open(template).read() - open(paths.KRB5_FREEIPA, "w+").write(contents) + os.path.basename(paths.KRB5_FREEIPA) + ".template" + ) + shutil.copy(template, paths.KRB5_FREEIPA) os.chmod(paths.KRB5_FREEIPA, 0x644) # Then, perform the rest of our configuration into krb5.conf itself.