From 8306b886e9d24a5bbeafedf315724f97b3ae86d4 Mon Sep 17 00:00:00 2001 From: Jaanus Torp Date: Thu, 16 Mar 2017 15:12:22 +0000 Subject: Allow also 444 for security file mode --- sway/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index f46ce882..46faf643 100644 --- a/sway/config.c +++ b/sway/config.c @@ -547,8 +547,8 @@ bool load_main_config(const char *file, bool is_active) { list_qsort(secconfigs, qstrcmp); for (int i = 0; i < secconfigs->length; ++i) { char *_path = secconfigs->items[i]; - if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || (s.st_mode & 0777) != 0644) { - sway_log(L_ERROR, "Refusing to load %s - it must be owned by root and mode 644", _path); + if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 || (((s.st_mode & 0777) != 0644) && (s.st_mode & 0777) != 0444)) { + sway_log(L_ERROR, "Refusing to load %s - it must be owned by root and mode 644 or 444", _path); success = false; } else { success = success && load_config(_path, config); -- cgit v1.2.3