From d6bd666b3f37e3425429ee90541442dbd2a777b7 Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Wed, 15 Apr 2026 09:29:24 +0200 Subject: [PATCH] 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 --- src/agent/src/rpc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agent/src/rpc.rs b/src/agent/src/rpc.rs index 59ecdd13e7..9e41487284 100644 --- a/src/agent/src/rpc.rs +++ b/src/agent/src/rpc.rs @@ -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())?;