Browse Source

Fixed critcal bug in virtual path to realpath translator in public hierarchy folder sharing

TC Micro-Server 4 years ago
parent
commit
aa2d1758e1

+ 11 - 4
documents/1.110 release drawing/postcard.png


+ 4 - 5
mod/user/directoryHandler.go

@@ -4,11 +4,7 @@ import (
 	"errors"
 	"path/filepath"
 	"strings"
-
-	//"log"
 	"os"
-
-	//storage "imuslab.com/arozos/mod/storage"
 	fs "imuslab.com/arozos/mod/filesystem"
 )
 
@@ -88,7 +84,7 @@ func (u *User) VirtualPathToRealPath(vpath string) (string, error) {
 			if storage.Hierarchy == "user" {
 				return filepath.Clean(storage.Path) + "/users/" + u.Username + subpath, nil
 			} else {
-				return filepath.Clean(storage.Path) + "/" + subpath, nil
+				return filepath.Clean(storage.Path) + subpath, nil
 			}
 
 		}
@@ -214,6 +210,9 @@ func getIDFromVirtualPath(vpath string) (string, string, error) {
 		return "", "", errors.New("Path missing Virtual Device ID. Given: " + vpath)
 	}
 
+	//Clean up the virutal path 
+	vpath = filepath.ToSlash(filepath.Clean(vpath))
+
 	tmp := strings.Split(vpath, ":")
 	vdID := tmp[0]
 	pathSlice := tmp[1:]

+ 1 - 1
start.sh

@@ -1,2 +1,2 @@
 #!/bin/bash
-sudo ./arozos -hostname "ArozOS" -port 80
+sudo ./arozos -hostname "ArozOS" -port 8082 -tls=true -tls_port 8443 -allow_upnp=true

+ 0 - 0
subservice/WsTTY/.gitignore