Skip to content

Commit 2a86f15

Browse files
committed
fix: removed config file owner check
1 parent 6fb610f commit 2a86f15

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

mamonsu/lib/config.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,19 @@ def __init__(self, cfg_file=None, plugin_directories=None):
8181
sys.stderr.write('Config file is empty: {0}\n'.format(cfg_file))
8282
sys.exit(1)
8383
if cfg_file is not None:
84-
if platform.LINUX:
85-
config_status = int(repr(oct(os.stat(cfg_file).st_mode))[:-1][-3:])
86-
config_owner = pwd.getpwuid(os.stat(cfg_file).st_uid).pw_name
87-
if not (config_status == 600 and config_owner == "mamonsu"):
88-
logging.info(
89-
"Shut down because of incorrect config file {0} permissions. It must be r/w for mamonsu user only (600).".format(
90-
cfg_file))
91-
sys.stderr.write(
92-
"Please, check your config file {0} permissions. It must be r/w for mamonsu user only (600).\n".format(
93-
cfg_file))
94-
sys.exit(1)
84+
# TODO: instead of hardcoded "mamonsu" user get real mamonsu owner user
85+
# and check if config file belongs to this user
86+
# if platform.LINUX:
87+
# config_status = int(repr(oct(os.stat(cfg_file).st_mode))[:-1][-3:])
88+
# config_owner = pwd.getpwuid(os.stat(cfg_file).st_uid).pw_name
89+
# if not (config_status == 600 and config_owner == "mamonsu"):
90+
# logging.info(
91+
# "Shut down because of incorrect config file {0} permissions. It must be r/w for mamonsu user only (600).".format(
92+
# cfg_file))
93+
# sys.stderr.write(
94+
# "Please, check your config file {0} permissions. It must be r/w for mamonsu user only (600).\n".format(
95+
# cfg_file))
96+
# sys.exit(1)
9597
self.config.read_file(open(cfg_file))
9698

9799
plugins = self.fetch('plugins', 'directory', str)

0 commit comments

Comments
 (0)