aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2024-02-03 23:00:52 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2024-02-03 23:00:52 +0100
commit88e99fa84fc4537653adbd99aa0d11781c184774 (patch)
tree7d3d222ad34966825f1b969de50a4368c5664e64
parentEnsure get_text_width() returns a positive value (diff)
downloadsway-88e99fa84fc4537653adbd99aa0d11781c184774.tar.gz
sway-88e99fa84fc4537653adbd99aa0d11781c184774.tar.zst
sway-88e99fa84fc4537653adbd99aa0d11781c184774.zip
Drop old security config remnants
-rw-r--r--sway/config.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/sway/config.c b/sway/config.c
index 4b51dc73..64ad9c70 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -494,56 +494,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
494 494
495 config->reading = true; 495 config->reading = true;
496 496
497 // Read security configs 497 bool success = load_config(path, config, &config->swaynag_config_errors);
498 // TODO: Security
499 bool success = true;
500 /*
501 DIR *dir = opendir(SYSCONFDIR "/sway/security.d");
502 if (!dir) {
503 sway_log(SWAY_ERROR,
504 "%s does not exist, sway will have no security configuration"
505 " and will probably be broken", SYSCONFDIR "/sway/security.d");
506 } else {
507 list_t *secconfigs = create_list();
508 char *base = SYSCONFDIR "/sway/security.d/";
509 struct dirent *ent = readdir(dir);
510 struct stat s;
511 while (ent != NULL) {
512 char *_path = malloc(strlen(ent->d_name) + strlen(base) + 1);
513 strcpy(_path, base);
514 strcat(_path, ent->d_name);
515 lstat(_path, &s);
516 if (S_ISREG(s.st_mode) && ent->d_name[0] != '.') {
517 list_add(secconfigs, _path);
518 }
519 else {
520 free(_path);
521 }
522 ent = readdir(dir);
523 }
524 closedir(dir);
525
526 list_qsort(secconfigs, qstrcmp);
527 for (int i = 0; i < secconfigs->length; ++i) {
528 char *_path = secconfigs->items[i];
529 if (stat(_path, &s) || s.st_uid != 0 || s.st_gid != 0 ||
530 (((s.st_mode & 0777) != 0644) &&
531 (s.st_mode & 0777) != 0444)) {
532 sway_log(SWAY_ERROR,
533 "Refusing to load %s - it must be owned by root "
534 "and mode 644 or 444", _path);
535 success = false;
536 } else {
537 success = success && load_config(_path, config);
538 }
539 }
540
541 list_free_items_and_destroy(secconfigs);
542 }
543 */
544
545 success = success && load_config(path, config,
546 &config->swaynag_config_errors);
547 498
548 if (validating) { 499 if (validating) {
549 free_config(config); 500 free_config(config);