Skip to content

Commit 8ad6880

Browse files
authored
Merge pull request #144 from morisja/reduce_logging_for_non_existent_netgroup
Correctly handle lookups of missing netgroups
2 parents 2a32997 + b450b57 commit 8ad6880

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/handlers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ impl NetgroupWithName {
347347
};
348348

349349
if unsafe { setnetgrent(netgroup_name.as_ptr() as *const c_char) } != 1 {
350-
anyhow::bail!("Error: Could not open netgroup {}", self.name);
350+
//setnetgrent returns 0 if the netgroup cannot be found
351+
return Ok(results);
351352
}
352-
353353
let mut buffer = vec![0 as c_char; 4096];
354354
let mut host: *mut c_char = std::ptr::null_mut();
355355
let mut user: *mut c_char = std::ptr::null_mut();

0 commit comments

Comments
 (0)