truststore: check if profile is a directory before joining cert*.db (#33)

This commit is contained in:
ansemjo
2018-07-04 18:59:33 +02:00
committed by Filippo Valsorda
parent 2e954de528
commit 5a2f42dee6

View File

@@ -97,6 +97,9 @@ func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
return return
} }
for _, profile := range profiles { for _, profile := range profiles {
if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
continue
}
if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) { if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
f("dbm:" + profile) f("dbm:" + profile)
found++ found++