Function login_cap::secure_path [−][src]
pub fn secure_path(path: &str) -> Result<bool, Error>
Expand description
Check whether the path is secure
Returns Ok(true) if the path is secure, Ok(false) otherwise
Returns Err if an error occurs
Example:
assert!(secure_path("/etc/passwd").unwrap()); assert_eq!(secure_path("/etc/").unwrap(), false);
From login_getclass(3)
:
The secure_path() function takes a path name and returns 0 if the path name is secure, -1 if not. To be secure a path must exist, be a regular file (and not a directory), owned by root, and only writable by the owner (root).