diff --git a/cmd/plakar/subcommands/ls/ls.go b/cmd/plakar/subcommands/ls/ls.go index dbe7a281..108c6eca 100644 --- a/cmd/plakar/subcommands/ls/ls.go +++ b/cmd/plakar/subcommands/ls/ls.go @@ -138,7 +138,11 @@ func list_snapshots(ctx *appcontext.AppContext, repo *repository.Repository, use func list_snapshot(ctx *appcontext.AppContext, repo *repository.Repository, snapshotPath string, recursive bool) error { prefix, pathname := utils.ParseSnapshotID(snapshotPath) - pathname = path.Clean(pathname) + if pathname == "" { + pathname = "/" + } else { + pathname = path.Clean(pathname) + } snap, err := utils.OpenSnapshotByPrefix(repo, prefix) if err != nil { diff --git a/objects/fileinfo.go b/objects/fileinfo.go index 0ed40fcb..d64ac70f 100644 --- a/objects/fileinfo.go +++ b/objects/fileinfo.go @@ -71,7 +71,7 @@ func (f FileInfo) Nlink() uint16 { } func (f FileInfo) Sys() any { - return nil + return f } func (f FileInfo) Username() string { diff --git a/objects/fileinfo_test.go b/objects/fileinfo_test.go index a1e43e13..f5be68b7 100644 --- a/objects/fileinfo_test.go +++ b/objects/fileinfo_test.go @@ -229,8 +229,4 @@ func TestFileInfoFromStat(t *testing.T) { if fileInfo.Groupname() != groupname { t.Errorf("expected Groupname %v, got %v", groupname, fileInfo.Lgroupname) } - - if fileInfo.Sys() != nil { - t.Errorf("expected nil, got %v", fileInfo.Sys()) - } }