|
|
@ -6,9 +6,9 @@ use std::os::unix::fs::MetadataExt; |
|
|
|
|
|
|
|
use users::get_user_by_name;
|
|
|
|
|
|
|
|
use symbols::Symbol;
|
|
|
|
use command_runner::CommandRunner;
|
|
|
|
|
|
|
|
use resources::Resource;
|
|
|
|
use symbols::Symbol;
|
|
|
|
|
|
|
|
pub struct Owner<'a, D> where D: AsRef<str> + fmt::Display {
|
|
|
|
path: D,
|
|
|
@ -33,6 +33,10 @@ impl<'a, D> Symbol for Owner<'a, D> where D: AsRef<str> + fmt::Display { |
|
|
|
try!(self.command_runner.run_with_args("chown", &[self.user_name.borrow(), self.path.as_ref()]));
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_prerequisites(&self) -> Vec<Resource> {
|
|
|
|
vec![ Resource::new("user", self.user_name.to_string()) ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, D> fmt::Display for Owner<'a, D> where D: AsRef<str> + fmt::Display {
|
|
|
|