diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-06 12:42:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 12:42:38 -0400 |
commit | 97daffea58b880c9b62dde02cd2dcd3c09f362eb (patch) | |
tree | 46fdacc606985064c4176e63c688e62621852588 | |
parent | fff684b98eb9a06e915f9b7dd9ebce1ceb95dede (diff) | |
parent | e7df811f100f74dc005efcd12818742f040cb940 (diff) | |
download | sway-97daffea58b880c9b62dde02cd2dcd3c09f362eb.tar.xz |
Merge pull request #1385 from lbonn/sec-no-hidden
Security config: skip hidden files
-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) { strcpy(_path, base); strcat(_path, ent->d_name); lstat(_path, &s); - if (S_ISREG(s.st_mode)) { + if (S_ISREG(s.st_mode) && ent->d_name[0] != '.') { list_add(secconfigs, _path); } + else { + free(_path); + } ent = readdir(dir); } closedir(dir); |