mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-04-26 10:32:28 +00:00
agent: fix naming for symlinks in CopyFile
The agent referred to the `data` field of an incoming CopyFileRequest as the 'src'. This is misleading, because 'source' is not mentioned in the specification (where links are just a path with attached bytes), and because the documentation for the `ln` utility calls the path LINK_NAME and the data TARGET. This commit fixes the glitch and calls the first argument to `symlinkat` the target. Signed-off-by: Markus Rudy <mr@edgeless.systems>
This commit is contained in:
@@ -2191,8 +2191,8 @@ fn do_copy_file(req: &CopyFileRequest) -> Result<()> {
|
||||
}
|
||||
|
||||
// Create new symbolic link
|
||||
let src = PathBuf::from(OsStr::from_bytes(&req.data));
|
||||
unistd::symlinkat(&src, None, &path)?;
|
||||
let symlink_target = PathBuf::from(OsStr::from_bytes(&req.data));
|
||||
unistd::symlinkat(&symlink_target, None, &path)?;
|
||||
|
||||
// Set symlink ownership (permissions not supported for symlinks)
|
||||
let path_str = CString::new(path.as_os_str().as_bytes())?;
|
||||
|
||||
Reference in New Issue
Block a user