Skip to content

Commit

Permalink
fix check_masked_device_nodes to return the failure result of all modes
Browse files Browse the repository at this point in the history
Signed-off-by: nayuta-ai <[email protected]>
  • Loading branch information
nayuta-ai committed Feb 1, 2025
1 parent b4e3511 commit 7f6782f
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,18 @@ fn test_mode(mode: u32) -> TestResult {
}

fn check_masked_device_nodes() -> TestResult {
let modes = [
[
SFlag::S_IFBLK.bits() | 0o666,
SFlag::S_IFCHR.bits() | 0o666,
SFlag::S_IFIFO.bits() | 0o666,
];
for mode in modes {
let res = test_mode(mode);
if let TestResult::Failed(_) = res {
return res;
}
}
TestResult::Passed
]
.iter()
.map(|mode| test_mode(*mode))
.find(|res| match res {
TestResult::Failed(_) => true,
TestResult::Passed => false,
})
.unwrap_or(TestResult::Passed)
}

pub fn get_linux_masked_paths_tests() -> TestGroup {
Expand Down

0 comments on commit 7f6782f

Please sign in to comment.