aboutsummaryrefslogtreecommitdiffstats
path: root/sway/main.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-12-17 15:19:50 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-12-17 15:21:57 -0500
commit1172566d4e298aa6c3555a0d606af4ff31d0db48 (patch)
treea6afcfbbecef26cc6ecaac0fad75268175fe9a51 /sway/main.c
parentMerge pull request #996 from woutershep/datadir (diff)
downloadsway-1172566d4e298aa6c3555a0d606af4ff31d0db48.tar.gz
sway-1172566d4e298aa6c3555a0d606af4ff31d0db48.tar.zst
sway-1172566d4e298aa6c3555a0d606af4ff31d0db48.zip
Change how security config is loaded0.11-rc3
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/sway/main.c b/sway/main.c
index d41eb292..e8a02e7a 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -179,37 +179,6 @@ static void security_sanity_check() {
179 "!! DANGER !! " SYSCONFDIR "/sway is not secure! It should be owned by root and set to 0755 at the minimum"); 179 "!! DANGER !! " SYSCONFDIR "/sway is not secure! It should be owned by root and set to 0755 at the minimum");
180 } 180 }
181 } 181 }
182 struct {
183 char *command;
184 enum command_context context;
185 bool checked;
186 } expected[] = {
187 { "reload", CONTEXT_BINDING, false },
188 { "permit", CONTEXT_CONFIG, false },
189 { "reject", CONTEXT_CONFIG, false },
190 { "ipc", CONTEXT_CONFIG, false },
191 };
192 int expected_len = 4;
193 for (int i = 0; i < config->command_policies->length; ++i) {
194 struct command_policy *policy = config->command_policies->items[i];
195 for (int j = 0; j < expected_len; ++j) {
196 if (strcmp(expected[j].command, policy->command) == 0) {
197 expected[j].checked = true;
198 if (expected[j].context != policy->context) {
199 sway_log(L_ERROR,
200 "!! DANGER !! Command security policy for %s should be set to %s",
201 expected[j].command, command_policy_str(expected[j].context));
202 }
203 }
204 }
205 }
206 for (int j = 0; j < expected_len; ++j) {
207 if (!expected[j].checked) {
208 sway_log(L_ERROR,
209 "!! DANGER !! Command security policy for %s should be set to %s",
210 expected[j].command, command_policy_str(expected[j].context));
211 }
212 }
213} 182}
214 183
215int main(int argc, char **argv) { 184int main(int argc, char **argv) {