Repository navigation
9d6fb8a
Pre-releaserefactor(selkies): Deny raw path writes and program starts where requests are handled
crates/selkies/clippy.toml lists the std::fs, tokio::fs, std::os::unix::fs
and nix calls that create, write, remove, or rename by path, and the two
Command::new. The crate allows the lint at its roots, and the modules
that handle requests (files, http, ws, webrtc, input, clipboard, pelorus)
deny it outside their tests, so a handler that writes a path a request
names other than through files::confine, or starts a program, fails
clippy unless an #[expect] there says why. confine is that place for
paths; the other thirteen are the server's own paths (the file manager's
root at start, the print spool, the CUPS scheduler's tree, the
unix_socket, the TLS pair, Pelorus' configuration file), fixed programs
(the app runner, xdotool, the clipboard tool), and the commands
command_enabled turns on (cmd, Pelorus' shell tool).
Two writes are written the way the lint asks instead: a chunked upload's
staging file is sized and removed relative to the directory descriptor
the walk verified, and through a fresh walk when it expires, rather than
by a path joined from the request; a folder archive is staged in
tempfile::tempfile(), unlinked as it is created.
clippy.toml is found from the crate's manifest directory, so no other
crate's lints change. cargo clippy --workspace --all-targets -D warnings
passes, and fails on a raw std::fs::write added to files/manager.rs and a
tokio::process::Command::new added to ws/handler.rs; cargo test -p
selkies --lib passes.