Skip to content

Commit

Permalink
Use safer makedirs function
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinekitty committed Dec 26, 2016
1 parent 466d65f commit dbbae94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modoboa_installer/scripts/postfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def post_run(self):
chroot_dir = "/var/spool/postfix/etc"
chroot_files = ["services", "resolv.conf"]
if not os.path.exists(chroot_dir):
os.mkdir(chroot_dir)
utils.mkdir(chroot_dir)
for f in chroot_files:
path = os.path.join(chroot_dir, f)
if not os.path.exists(path):
Expand Down
2 changes: 1 addition & 1 deletion modoboa_installer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def dist_name():
def mkdir(path, mode, uid, gid):
"""Create a directory."""
if not os.path.exists(path):
os.mkdir(path, mode)
os.makedirs(path, mode)
else:
os.chmod(path, mode)
os.chown(path, uid, gid)
Expand Down

0 comments on commit dbbae94

Please sign in to comment.