Skip to content

Commit

Permalink
replace fs.Stat with fs.Lstat
Browse files Browse the repository at this point in the history
  • Loading branch information
t0rr3sp3dr0 committed Feb 12, 2024
1 parent 0ee6f52 commit 7d4f829
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func ToFileAttribute(info os.FileInfo, filePath string) *FileAttribute {
// tryStat attempts to create a FileAttribute from a path.
func tryStat(fs billy.Filesystem, path []string) *FileAttribute {
fullPath := fs.Join(path...)
attrs, err := fs.Stat(fullPath)
attrs, err := fs.Lstat(fullPath)
if err != nil || attrs == nil {
Log.Errorf("err loading attrs for %s: %v", fs.Join(path...), err)
return nil
Expand Down
2 changes: 1 addition & 1 deletion nfs_ongetattr.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func onGetAttr(ctx context.Context, w *response, userHandle Handler) error {
}

fullPath := fs.Join(path...)
info, err := fs.Stat(fullPath)
info, err := fs.Lstat(fullPath)
if err != nil {
if os.IsNotExist(err) {
return &NFSStatusError{NFSStatusNoEnt, err}
Expand Down

0 comments on commit 7d4f829

Please sign in to comment.