mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
vfs: store root dir
so we don't need to pass it over and over
This commit is contained in:
@@ -1515,6 +1515,7 @@ func TestQuotaDisabledError(t *testing.T) {
|
||||
func TestMaxSessions(t *testing.T) {
|
||||
usePubKey := false
|
||||
u := getTestUser(usePubKey)
|
||||
u.Username += "1"
|
||||
u.MaxSessions = 1
|
||||
user, _, err := httpd.AddUser(u, http.StatusOK)
|
||||
if err != nil {
|
||||
@@ -2904,7 +2905,7 @@ func TestRootDirCommands(t *testing.T) {
|
||||
func TestRelativePaths(t *testing.T) {
|
||||
user := getTestUser(true)
|
||||
path := filepath.Join(user.HomeDir, "/")
|
||||
fs := vfs.NewOsFs("")
|
||||
fs := vfs.NewOsFs("", user.GetHomeDir())
|
||||
rel := fs.GetRelativePath(path, user.GetHomeDir())
|
||||
if rel != "/" {
|
||||
t.Errorf("Unexpected relative path: %v", rel)
|
||||
|
||||
Reference in New Issue
Block a user