diff --git a/proxmox-tools/src/fs.rs b/proxmox-tools/src/fs.rs index aad6dc88..b46a072e 100644 --- a/proxmox-tools/src/fs.rs +++ b/proxmox-tools/src/fs.rs @@ -5,7 +5,7 @@ use std::path::Path; use failure::{bail, format_err, Error}; use nix::sys::stat; -use nix::unistd; +use nix::unistd::{self, Gid, Uid}; use serde_json::Value; use super::try_block; @@ -80,8 +80,8 @@ pub fn file_set_contents_full>( path: P, data: &[u8], perm: Option, - owner: Option, - group: Option, + owner: Option, + group: Option, ) -> Result<(), Error> { let path = path.as_ref(); @@ -130,11 +130,7 @@ pub fn file_set_contents_full>( } /// Change ownership of an open file handle -pub fn fchown( - fd: RawFd, - owner: Option, - group: Option, -) -> Result<(), Error> { +pub fn fchown(fd: RawFd, owner: Option, group: Option) -> Result<(), Error> { // According to the POSIX specification, -1 is used to indicate that owner and group // are not to be changed. Since uid_t and gid_t are unsigned types, we have to wrap // around to get -1 (copied fron nix crate). @@ -157,8 +153,8 @@ pub fn fchown( pub fn create_dir_chown>( path: P, perm: Option, - owner: Option, - group: Option, + owner: Option, + group: Option, ) -> Result<(), nix::Error> { let mode: stat::Mode = perm.unwrap_or(stat::Mode::from_bits_truncate(0o770));