Added file permissions option to IPAChangeConf.newConf()

Also added information about why os.chmod is called sometimes
after newConf() calls.

https://fedorahosted.org/freeipa/ticket/6392

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Stanislav Laznicka
2016-11-03 12:29:45 +01:00
committed by Jan Cholasta
parent 990e1acb1a
commit b068d3336a
3 changed files with 8 additions and 3 deletions

View File

@@ -360,6 +360,7 @@ def configure_ipa_conf(
target_fname = paths.IPA_DEFAULT_CONF
fstore.backup_file(target_fname)
ipaconf.newConf(target_fname, opts)
# umask applies when creating a new file but we want 0o644 here
os.chmod(target_fname, 0o644)
@@ -746,6 +747,7 @@ def configure_krb5_conf(
root_logger.debug("%s", krbconf.dump(opts))
krbconf.newConf(filename, opts)
# umask applies when creating a new file but we want 0o644 here
os.chmod(filename, 0o644)