# Change pam_acct_mgmt to use username when groupattr is
# 'memberUid', Closes: #292030, #341541
--- libpam-ldap-184.orig/pam_ldap.c
+++ libpam-ldap-184/pam_ldap.c
@@ -4013,9 +4013,15 @@
   /* group auth, per Chris's pam_ldap_auth module */
   if (session->conf->groupdn != NULL)
     {
+      const char *value = session->info->userdn;
+
+      if (strcasecmp(session->conf->groupattr, "memberUid") == 0) 
+          value = username;
+          
       rc = ldap_compare_s (session->ld,
 			   session->conf->groupdn,
-			   session->conf->groupattr, session->info->userdn);
+			   session->conf->groupattr, value);
+
       if (rc != LDAP_COMPARE_TRUE)
 	{
 	  snprintf (buf, sizeof buf, "You must be a %s of %s to login.",
