From 376a08840b970f6e6d36c56bfd85b97c29a044cf Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 24 Jun 2021 17:28:20 +0200 Subject: conf: list unencrypted conf files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By ignoring unencrypted ones, the tunnel tracker would miss running configurations at startup. Reported-by: Станислав Мацак Signed-off-by: Jason A. Donenfeld --- conf/store.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'conf') 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++ } -- cgit v1.2.3-59-g8ed1b