fix: cert_file should be normalized as well

This commit is contained in:
sxyazi 2026-03-07 15:44:22 +08:00
parent 14fb19353a
commit 0d07936d7b
No known key found for this signature in database

View file

@ -53,6 +53,11 @@ impl ServiceSftp {
.ok_or_else(|| io::Error::other("key_file must be either empty or an absolute path"))?;
}
if !self.cert_file.as_os_str().is_empty() {
self.cert_file = normalize_path(mem::take(&mut self.cert_file))
.ok_or_else(|| io::Error::other("cert_file must be either empty or an absolute path"))?;
}
self.identity_agent = if self.identity_agent.as_os_str().is_empty() {
std::env::var_os("SSH_AUTH_SOCK")
.map(PathBuf::from)