When a symlink was intended to be synced, sync tried to run a chown over it. The bug occurs when the target file didn't exist in the sync container context.
Example:
mounts: {
'/azk/#{manifest.dir}' : sync("."),
'/azk/other/file' : path("../file"), // may or may not be mounted
}
$ ls -l ./link
lrwxrwxrwx 1 user users 27 Mar 31 19:28 link -> ../file
In this case, the sync occurs for the current dir (.), which contains a symlink named link that points to the file ../file. In the sync container, the file doesn't exist, and the chown fails.
Adding the -h option, the chown command is applied to the symlink itself, instead of be applied to the target file.
This PR intends to fix a bug in the
sync
mount.When a symlink was intended to be synced,
sync
tried to run achown
over it. The bug occurs when the target file didn't exist in thesync
container context.Example:
In this case, the
sync
occurs for the current dir (.
), which contains a symlink namedlink
that points to the file../file
. In thesync
container, thefile
doesn't exist, and thechown
fails.Adding the
-h
option, thechown
command is applied to the symlink itself, instead of be applied to the target file.