Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep owner when backing up CA.cfg #1693

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions ipaserver/install/dogtaginstance.py
Expand Up @@ -469,8 +469,12 @@ def backup_config(self):
"""
Create a backup copy of CS.cfg
"""
path = self.config
config = self.config
bak = config + '.ipabkp'
if services.knownservices['pki_tomcatd'].is_running('pki-tomcat'):
raise RuntimeError(
"Dogtag must be stopped when creating backup of %s" % path)
shutil.copy(path, path + '.ipabkp')
"Dogtag must be stopped when creating backup of %s" % config)
shutil.copy(config, bak)
# shutil.copy() doesn't copy owner
s = os.stat(config)
os.chown(bak, s.st_uid, s.st_gid)