From 8828bb7dddc0d156168c93d10a82dab4dbaf1b13 Mon Sep 17 00:00:00 2001 From: Vladislav Shub Date: Thu, 2 Jun 2016 16:29:01 +0300 Subject: [PATCH] Removed absolute path validation for ExternalTemplate --- config/gonew_config.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/gonew_config.go b/config/gonew_config.go index 3181a43..cbff19e 100644 --- a/config/gonew_config.go +++ b/config/gonew_config.go @@ -17,7 +17,6 @@ import ( "github.com/bmatsuo/go-validate" "io/ioutil" "os" - "strings" ) type configInheritanceGraph map[string]map[string]interface{} @@ -111,9 +110,7 @@ type ExternalTemplate string func (config ExternalTemplate) Validate() (err error) { path := string(config) var info os.FileInfo - if !strings.HasPrefix(path, "/") { - return errors.New("relative path " + path) - } else if info, err = os.Stat(path); err != nil { + if info, err = os.Stat(path); err != nil { return } else if !info.IsDir() { return errors.New("not a directory " + path)