Commit c70f1e10 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Make .agkyra with owner permissions only

parent bf0b4d63
......@@ -28,6 +28,7 @@ The operations of a sync are similar to the operations of a cloud, as they are
implemented in kamaki.cli.config
"""
import os
import stat
from re import match
from ConfigParser import Error
from kamaki.cli import config
......@@ -48,7 +49,7 @@ if os.path.exists(AGKYRA_DIR):
if not os.path.isdir(AGKYRA_DIR):
raise Exception("Cannot create dir '%s'; file exists" % AGKYRA_DIR)
else:
os.makedirs(AGKYRA_DIR)
os.makedirs(AGKYRA_DIR, mode=stat.S_IRWXU)
CONFIG_PATH = os.path.join(AGKYRA_DIR, 'config.rc')
config.CONFIG_PATH = CONFIG_PATH
......
......@@ -18,6 +18,7 @@ import sys
import threading
import logging
import ctypes
import stat
from functools import wraps
......@@ -122,7 +123,7 @@ class SyncerSettings():
default_settings_path = join_path(home_dir, GLOBAL_SETTINGS_NAME)
self.settings_path = utils.to_unicode(
kwargs.get("agkyra_path", default_settings_path))
self.create_dir(self.settings_path)
self.create_dir(self.settings_path, mode=stat.S_IRWXU)
self.instances_path = join_path(self.settings_path, INSTANCES_NAME)
self.create_dir(self.instances_path)
......@@ -233,13 +234,13 @@ class SyncerSettings():
logger.info("Filesystem is case-%ssensitive" % case)
self.case_insensitive = case_insensitive
def create_dir(self, path):
def create_dir(self, path, mode=0777):
if os.path.exists(path):
if os.path.isdir(path):
return
raise Exception("Cannot create dir '%s'; file exists" % path)
logger.warning("Creating dir: '%s'" % path)
os.makedirs(path)
os.makedirs(path, mode=mode)
return path
@ssl_fall_back
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment