diff --git a/rust/himmelblaud/src/cache.rs b/rust/himmelblaud/src/cache.rs index 5a344e5f0dd..764753d0037 100644 --- a/rust/himmelblaud/src/cache.rs +++ b/rust/himmelblaud/src/cache.rs @@ -294,7 +294,6 @@ impl GroupEntry { } } -#[cfg(test)] impl GroupEntry { pub fn new(uuid: &str) -> Self { GroupEntry { diff --git a/rust/himmelblaud/src/himmelblaud/himmelblaud_getpwnam.rs b/rust/himmelblaud/src/himmelblaud/himmelblaud_getpwnam.rs index 576a62e78e6..40a7bffcbdc 100644 --- a/rust/himmelblaud/src/himmelblaud/himmelblaud_getpwnam.rs +++ b/rust/himmelblaud/src/himmelblaud/himmelblaud_getpwnam.rs @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +use crate::cache::GroupEntry; use crate::himmelblaud::Resolver; use crate::utils::split_username; use dbg::{DBG_ERR, DBG_WARNING}; @@ -59,6 +60,10 @@ impl Resolver { })?; // Store the calculated uid -> upn map in the cache self.uid_cache.store(uid, &upn)?; + // Store the primary group (which is a fake group matching the user upn) + let mut group = GroupEntry::new(upn); + group.add_member(upn); + self.group_cache.merge_groups(upn, vec![group])?; let (cn, domain) = match split_username(&upn) { Ok(res) => res, Err(e) => {