aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/conf
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-06-24 17:28:20 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-06-25 22:21:37 +0200
commit376a08840b970f6e6d36c56bfd85b97c29a044cf (patch)
tree109c062f4c064eb1c2855fbae11e2440efa2bf06 /conf
parentbuild: use newer wg(8) without elevation (diff)
downloadwireguard-windows-376a08840b970f6e6d36c56bfd85b97c29a044cf.tar.xz
wireguard-windows-376a08840b970f6e6d36c56bfd85b97c29a044cf.zip
conf: list unencrypted conf files
By ignoring unencrypted ones, the tunnel tracker would miss running configurations at startup. Reported-by: Станислав Мацак <smatsak@mail.ru> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conf')
-rw-r--r--conf/store.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/conf/store.go b/conf/store.go
index f6f450c6..def94836 100644
--- a/conf/store.go
+++ b/conf/store.go
@@ -29,8 +29,8 @@ func ListConfigNames() ([]string, error) {
configs := make([]string, len(files))
i := 0
for _, file := range files {
- name := filepath.Base(file.Name())
- if len(name) <= len(configFileSuffix) || !strings.HasSuffix(name, configFileSuffix) {
+ name, err := NameFromPath(file.Name())
+ if err != nil {
continue
}
if !file.Type().IsRegular() {
@@ -43,10 +43,6 @@ func ListConfigNames() ([]string, error) {
if info.Mode().Perm()&0444 == 0 {
continue
}
- name = strings.TrimSuffix(name, configFileSuffix)
- if !TunnelNameIsValid(name) {
- continue
- }
configs[i] = name
i++
}