mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: support symlink to the exec path.
PiperOrigin-RevId: 201049912 Change-Id: Idd937492217a4c2ca3d59c602e41576a3b203dd9
This commit is contained in:
@@ -106,7 +106,9 @@ func GetExecutablePath(exec, root string, env []string) (string, error) {
|
||||
// for.
|
||||
for _, p := range path {
|
||||
abs := filepath.Join(root, p, exec)
|
||||
if _, err := os.Stat(abs); err == nil {
|
||||
// Do not follow symlink link because the target is in the container
|
||||
// root filesystem.
|
||||
if _, err := os.Lstat(abs); err == nil {
|
||||
// We found it! Return the path relative to the root.
|
||||
return filepath.Join("/", p, exec), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user