Excessive permissions are granted to a file or directory. This issue is raised
when a permission mode greater than 0o755
is given.
The permission number can be a 3 or 4-digit numeric, the three rightmost digits represent the different components of the permissions: owner, group and others. Each digit is a sum of its component digits:
r
(read) bit = 4w
(write) bit = 2x
(execute) bit = 1For example, to give full permissions to a file owner and read permissions to
the group and all other users, use 0744
.
use std::fs::DirBuilder;
use std::os::unix::fs::DirBuilderExt;
let mut builder = DirBuilder::new();
builder.mode(0o777);
use std::fs::DirBuilder;
use std::os::unix::fs::DirBuilderExt;
let mut builder = DirBuilder::new();
builder.mode(0o755);