Bladeren bron

Added experimental fix to slash issue

Toby Chui 3 jaren geleden
bovenliggende
commit
0d4df3adaa
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 2 2
      mod/agi/agi.file.go
  2. 1 1
      mod/filesystem/abstractions/smbfs/smbfs.go

+ 2 - 2
mod/agi/agi.file.go

@@ -343,8 +343,8 @@ func (g *Gateway) injectFileLibFunctions(vm *otto.Otto, u *user.User) {
 					//Hidden file. Skip this
 					continue
 				}
-				thisRpath, _ := realpathToVirtualpath(fsh, filepath.ToSlash(file), u)
-				results = append(results, thisRpath)
+				thisVpath, _ := realpathToVirtualpath(fsh, file, u)
+				results = append(results, thisVpath)
 			}
 			reply, _ := vm.ToValue(results)
 			return reply

+ 1 - 1
mod/filesystem/abstractions/smbfs/smbfs.go

@@ -177,7 +177,7 @@ func (a ServerMessageBlockFileSystemAbstraction) VirtualPathToRealPath(subpath s
 func (a ServerMessageBlockFileSystemAbstraction) RealPathToVirtualPath(fullpath string, username string) (string, error) {
 	fullpath = filterFilepath(fullpath)
 	fullpath = strings.TrimPrefix(fullpath, "\\")
-	vpath := a.UUID + ":/" + filterFilepath(fullpath)
+	vpath := a.UUID + ":/" + filepath.ToSlash(fullpath)
 	return vpath, nil
 }