volume: drop TODO comment

the two operations are equivalent since securejoin.SecureJoin() has
solved the symlinks.  Prefer the Lstat version though to make sure
symlinks are never resolved and we do not end up using a path on the
host.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2022-06-25 14:21:52 +02:00
parent 443a2afdb5
commit a4094530bc

View File

@ -1648,8 +1648,6 @@ func (c *Container) mountNamedVolume(v *ContainerNamedVolume, mountpoint string)
}
// Do a manual stat on the source directory to verify existence.
// Skip the rest if it exists.
// TODO: Should this be stat or lstat? I'm using lstat because I
// think copy-up doesn't happen when the source is a link.
srcStat, err := os.Lstat(srcDir)
if err != nil {
if os.IsNotExist(err) {