From 51a7e5982fb8d6b6f6520790b77ad3c7050431b9 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 14 Nov 2010 12:21:57 -0500 Subject: [PATCH] Now that paths.go holds a reference to the entire Configuration, remove gJailRoot. --- src/paths.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/paths.go b/src/paths.go index 6a2be46..a538116 100644 --- a/src/paths.go +++ b/src/paths.go @@ -17,24 +17,22 @@ import ( "./config" ) -var gJailRoot string var gConfig *config.Configuration func SetConfig(aConfig *config.Configuration) { gConfig = aConfig - gJailRoot = aConfig.JailRoot } func canonicalizePath(raw_path string) string { - raw_path = path.Join(gJailRoot, raw_path) + raw_path = path.Join(gConfig.JailRoot, raw_path) return path.Clean(raw_path) } func checkInJail(the_path string) bool { - if len(the_path) < len(gJailRoot) { + if len(the_path) < len(gConfig.JailRoot) { return false } - if the_path[0:len(gJailRoot)] != gJailRoot { + if the_path[0:len(gConfig.JailRoot)] != gConfig.JailRoot { return false } if strings.Index(the_path, "../") != -1 { -- 2.22.5