networking: load only *.conf files

All files found in UserNetPath that don't match the suffix '.conf' will be
ignored as a network configuration file.

Fixes #859.
This commit is contained in:
Stefan Junker
2015-05-02 21:47:53 -07:00
parent dd0b3af5f5
commit ddef17cf67
+6
View File
@@ -25,6 +25,7 @@ import (
"path"
"path/filepath"
"sort"
"strings"
"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/cni/pkg/plugin"
"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/types"
@@ -218,6 +219,11 @@ func loadUserNets() ([]activeNet, error) {
for _, filename := range files {
filepath := path.Join(UserNetPath, filename)
if !strings.HasSuffix(filepath, ".conf") {
continue
}
n, err := loadNet(filepath)
if err != nil {
return nil, err