Benign rust Download

strop-remote 0.16.0

“Owned SSH remote-file transport and native path identity for strop”

Basename is uppercase README.mdContains an unbounded block loop
SHA-256ab3ea9e9bf2e7b99bfd3f3e69e2037fd22789af2840d229271700d8133dd775e

Evidence

Imports Rust process::Command command.rs · lines 1–10
1//! The ssh(1) invocation for one remote SFTP read. Pure construction, no
2//! side effects: the remote path never appears in this argv — filenames
3//! travel only inside the SFTP protocol on the session's pipes.
4
5use super::super::address::RemoteFile;
6use std::process::{Command, Stdio};
7
8/// A dedicated, noninteractive connection to the remote `sftp` subsystem.
9///
10/// User configuration stays in force …
Constructs a Rust process command command.rs · lines 25–33
25:20… subsystem(file: &RemoteFile) -> Command {
26 let mut command = Command::new("ssh");
27 command
28 .arg("-s")
⋯5 lines
Writes a file with Rust fs::write buffer.rs · lines 289–305
⋯4 lines
293}
294
295#[cfg(test)]
296mod safety_tests {
297 use super::*;
298
299 #[test]
300 fn save_refuses_external_change_unless_forced() {
301 let dir = tempfile::tempdir().unwrap();
302 let f = dir.path().join("f.txt");
303 std::fs::write(&f, "original\n").unwrap();
304 let mut b = Buffer::open(f.to_str().unwrap()).unwrap();
305 b.edit().insert(id::ByteOffs …
Reads a file into a Rust string buffer.rs · lines 312–319
312:14… set_modified(std::time::UNIX_EPOCH + std::time::Duration::from_secs(123))
313 .unwrap();
314 let err = b.prepare_save(None, false).unwrap().execute().unwrap_err();
315 assert_eq!(err.kind(), std::io::ErrorKind::PermissionDenied);
316 assert_eq!(std::fs::read_to_string(&f).unwrap(), "theirs\n");
317 let receipt = b.prepare_save(None, true).unwrap().execute().unwrap();
318 assert!(b.accept_save(receipt));
319 assert_eq!(std::fs::read_to_string(&f).unwrap(), "mine origina …
Rust set permissions call buffer.rs · lines 328–331
328:2… std::fs::write(&f, "#!/bin/sh\n").unwrap();
329 std::fs::set_permissions(&f, std::fs::Permissions::from_mode(0o750)).unwrap();
330 let mut b = Buffer::open(f.to_str().unwrap()).unwrap();
331 le …

Showing the top 5 files — 3 more files (18 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.