mkdir: permissions respects umask

- hardcoded default permissions changed to ones defined by umask
This commit is contained in:
Pyokyeong Son 2022-02-17 07:37:55 +00:00
parent 155647f6a8
commit ea175ce252

View file

@ -64,7 +64,10 @@ fn get_mode(matches: &ArgMatches, mode_had_minus_prefix: bool) -> Result<u32, St
}
Ok(new_mode)
}
None => Ok(DEFAULT_PERM),
None => {
// If no mode argument is specified return the mode from umask
Ok(mode::get_umask())
}
}
}
@ -119,7 +122,7 @@ pub fn uu_app<'a>() -> App<'a> {
.short('m')
.long(options::MODE)
.help("set file mode (not implemented on windows)")
.default_value("755"),
.takes_value(true),
)
.arg(
Arg::new(options::PARENTS)