Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 885 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 885 Bytes

Path Ratchet

LGPL 3.0 License Crates.io Workflow Status crev reviews

Prevent path traversal attacks at type level.

use std::path::PathBuf;
use path_ratchet::prelude::*;

let user_input = "/etc/shadow";
let mut filename = PathBuf::from("/tmp");
filename.push_component(SingleComponentPath::new(user_input).unwrap());