Skip to content

Commit

Permalink
getLocalFileList: fix symlink path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Aug 23, 2024
1 parent d5419b8 commit 1b3a678
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datasetIngestor/getLocalFileList.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ func handleSymlink(symlinkPath string, sourceFolder string) (bool, error) {
keep := true
pointee, _ := os.Readlink(symlinkPath) // just pass the file name
if !filepath.IsAbs(pointee) {
dir, err := filepath.Abs(filepath.Dir(symlinkPath))
symlinkAbs, err := filepath.Abs(filepath.Dir(symlinkPath))
if err != nil {
keep = false
err = fmt.Errorf("could not find absolute path of symlink at \"%s\": %v", symlinkPath, err)
return false, err
}
// log.Printf(" CWD path pointee :%v %v %v", dir, filepath.Dir(path), pointee)
pabs := filepath.Join(dir, filepath.Dir(symlinkPath), pointee)
pointee, err = filepath.EvalSymlinks(pabs)
pointeeAbs := filepath.Join(symlinkAbs, pointee)
pointee, err = filepath.EvalSymlinks(pointeeAbs)
if err != nil {
keep = false
err = fmt.Errorf("could not follow symlink: %v", err)
Expand Down

0 comments on commit 1b3a678

Please sign in to comment.