diff --git a/src/utils.rs b/src/utils.rs index 3d8de84..2eeea1f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -63,6 +63,12 @@ pub fn verify_elf_file(file_path: &str) -> Result<(), InjectionError> { } pub fn copy_file_to_tmp(file_path: &str) -> Result { + // skip if the file is already in /dev/local/tmp + if file_path.starts_with(TMP_DIR_PATH) { + info!("File is already in {}", TMP_DIR_PATH); + return Ok(file_path.to_string()); + } + let file_name = match std::path::Path::new(file_path).file_name() { Some(name) => name.to_str().unwrap(), None => {