Skip to content

Commit

Permalink
Merge pull request #144 from morisja/reduce_logging_for_non_existent_…
Browse files Browse the repository at this point in the history
…netgroup

Correctly handle lookups of missing netgroups
  • Loading branch information
leifwalsh authored Oct 23, 2024
2 parents 2a32997 + b450b57 commit 8ad6880
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ impl NetgroupWithName {
};

if unsafe { setnetgrent(netgroup_name.as_ptr() as *const c_char) } != 1 {
anyhow::bail!("Error: Could not open netgroup {}", self.name);
//setnetgrent returns 0 if the netgroup cannot be found
return Ok(results);
}

let mut buffer = vec![0 as c_char; 4096];
let mut host: *mut c_char = std::ptr::null_mut();
let mut user: *mut c_char = std::ptr::null_mut();
Expand Down

0 comments on commit 8ad6880

Please sign in to comment.