mirror of
https://github.com/CloudNebulaProject/vm-manager.git
synced 2026-04-10 13:20:41 +00:00
Set executable permissions (0755) on uploaded files via SFTP
This commit is contained in:
parent
b9d31acfa9
commit
548170cbe7
1 changed files with 14 additions and 0 deletions
|
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue