aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-03-16 14:06:03 -0400
committerGitHub <noreply@github.com>2017-03-16 14:06:03 -0400
commitec50b92bb43af7fc17f3c6d786bcbb585f673223 (patch)
treea00b20bface88b4ac872df001c4cc6946b657663 /sway/config.c
parent109f384771f75e4cc9f1a50411e7dbe921354a93 (diff)
parent8306b886e9d24a5bbeafedf315724f97b3ae86d4 (diff)
Merge pull request #1117 from jnsaff/master
Allow also 444 for security file mode
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c4
1 files changed, 2 insertions, 2 deletions
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);