Skip to content

Commit

Permalink
Really resolve the link, not just get a relative link (#558)
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka authored Sep 24, 2024
1 parent ded356c commit 9d63bae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/config/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func resolveTarget(fs v1.FS, target string) (string, error) {
if strings.Contains(target, "partlabel") || strings.Contains(target, "partuuid") {
return "", fmt.Errorf("target contains 'parlabel' or 'partuuid', looks like its a partition instead of a disk: %s", target)
}
device, err := fs.Readlink(target)
// Use EvanSymlinks to properly resolve the target
device, err := filepath.EvalSymlinks(target)
if err != nil {
return "", fmt.Errorf("failed to read device link for %s: %w", target, err)
}
Expand Down

0 comments on commit 9d63bae

Please sign in to comment.