Skip to main content

write_private

Function write_private 

Source
pub fn write_private(path: &Path, bytes: &[u8]) -> Result<()>
Expand description

Write a file only this account can read, with the permissions set as it is created.

Created restricted rather than tightened afterwards. Writing the bytes and then calling set_permissions leaves a window in which the file exists and is readable — short, real, and exactly the kind of detail that stays invisible until it matters. The token has always gone through here; the authority key in crate::tls has to, because a private key another account on the machine can read is the one thing that makes a constrained CA pointless.