summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_backup.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-12-09 13:40:04 +0100
committerTomas Babej <tbabej@redhat.com>2015-12-14 14:57:26 +0100
commit4272ba40ea909b1f783a6fada5b1eebb6efbdf93 (patch)
treee02fbd38e71f71a4848a62cf761cbfe1b964d192 /ipaserver/install/ipa_backup.py
parent5e2cd38ab998230aa81cd07196edfba2b62cb58d (diff)
downloadfreeipa-4272ba40ea909b1f783a6fada5b1eebb6efbdf93.tar.gz
freeipa-4272ba40ea909b1f783a6fada5b1eebb6efbdf93.tar.xz
freeipa-4272ba40ea909b1f783a6fada5b1eebb6efbdf93.zip
Explicitly call chmod on newly created directories
Without calling os.chmod(), umask is effective and may cause that directory is created with permission that causes failure. This can be related to https://fedorahosted.org/freeipa/ticket/5520 Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipaserver/install/ipa_backup.py')
-rw-r--r--ipaserver/install/ipa_backup.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py
index d19312876..8e9b258bf 100644
--- a/ipaserver/install/ipa_backup.py
+++ b/ipaserver/install/ipa_backup.py
@@ -271,8 +271,8 @@ class Backup(admintool.AdminTool):
os.chown(self.top_dir, pent.pw_uid, pent.pw_gid)
os.chmod(self.top_dir, 0o750)
self.dir = os.path.join(self.top_dir, "ipa")
- os.mkdir(self.dir, 0o750)
-
+ os.mkdir(self.dir)
+ os.chmod(self.dir, 0o750)
os.chown(self.dir, pent.pw_uid, pent.pw_gid)
self.header = os.path.join(self.top_dir, 'header')
@@ -588,7 +588,8 @@ class Backup(admintool.AdminTool):
backup_dir = os.path.join(paths.IPA_BACKUP_DIR, time.strftime('ipa-full-%Y-%m-%d-%H-%M-%S'))
filename = os.path.join(backup_dir, "ipa-full.tar")
- os.mkdir(backup_dir, 0o700)
+ os.mkdir(backup_dir)
+ os.chmod(backup_dir, 0o700)
cwd = os.getcwd()
os.chdir(self.dir)