Set executable permissions (0755) on uploaded files via SFTP

This commit is contained in:
Till Wegmueller 2026-04-07 21:32:25 +02:00
parent b9d31acfa9
commit 548170cbe7

View file

@ -201,6 +201,20 @@ pub fn upload(sess: &Session, local: &Path, remote: &Path) -> Result<()> {
detail: format!("SFTP write: {e}"), detail: format!("SFTP write: {e}"),
})?; })?;
// Close the file handle before setting permissions
drop(remote_file);
// Set executable permissions (0o755)
let stat = ssh2::FileStat {
size: None,
uid: None,
gid: None,
perm: Some(0o755),
atime: None,
mtime: None,
};
let _ = sftp.setstat(remote, stat);
Ok(()) Ok(())
} }