diff options
author | lbonn <bonnans.l@gmail.com> | 2017-10-06 16:23:59 +0200 |
---|---|---|
committer | lbonn <bonnans.l@gmail.com> | 2017-10-06 16:23:59 +0200 |
commit | e7df811f100f74dc005efcd12818742f040cb940 (patch) | |
tree | 46fdacc606985064c4176e63c688e62621852588 /sway/config.c | |
parent | Merge pull request #1384 from lbonn/move-workspace-fullname (diff) | |
download | sway-e7df811f100f74dc005efcd12818742f040cb940.tar.gz sway-e7df811f100f74dc005efcd12818742f040cb940.tar.zst sway-e7df811f100f74dc005efcd12818742f040cb940.zip |
Security config: skip hidden files
Also: fix a small memory leak
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c index 4cb080ab..5b2b6569 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -550,9 +550,12 @@ bool load_main_config(const char *file, bool is_active) { | |||
550 | strcpy(_path, base); | 550 | strcpy(_path, base); |
551 | strcat(_path, ent->d_name); | 551 | strcat(_path, ent->d_name); |
552 | lstat(_path, &s); | 552 | lstat(_path, &s); |
553 | if (S_ISREG(s.st_mode)) { | 553 | if (S_ISREG(s.st_mode) && ent->d_name[0] != '.') { |
554 | list_add(secconfigs, _path); | 554 | list_add(secconfigs, _path); |
555 | } | 555 | } |
556 | else { | ||
557 | free(_path); | ||
558 | } | ||
556 | ent = readdir(dir); | 559 | ent = readdir(dir); |
557 | } | 560 | } |
558 | closedir(dir); | 561 | closedir(dir); |