if ((rc = linklist_build((LDAP *)call_args[0], call_args[1], filter, attr_array,
&group_base, &group_count)) == LDAP_SUCCESS)
{
+ if (group_count != 1)
+ {
+ if (strlen(call_args[5]) != 0)
+ {
+ linklist_free(group_base);
+ group_count = 0;
+ group_base = NULL;
+ sprintf(filter, "(sAMAccountName=%s)", sam_group_name);
+ rc = linklist_build((LDAP *)call_args[0], call_args[1], filter,
+ attr_array, &group_base, &group_count);
+ }
+ }
if (group_count == 1)
{
(*sid_ptr) = group_base;
if ((rc = linklist_build((LDAP *)call_args[0], call_args[1], filter, attr_array,
&group_base, &group_count)) == LDAP_SUCCESS)
{
+ if (group_count != 1)
+ {
+ if (strlen(call_args[2]) != 0)
+ {
+ linklist_free(group_base);
+ group_count = 0;
+ group_base = NULL;
+ sprintf(filter, "(sAMAccountName=%s)", av[U_NAME]);
+ rc = linklist_build((LDAP *)call_args[0], call_args[1], filter,
+ attr_array, &group_base, &group_count);
+ }
+ }
if (group_count == 1)
{
(*sid_ptr) = group_base;
- (*sid_ptr)->member = strdup(av[L_NAME]);
+ (*sid_ptr)->member = strdup(av[U_NAME]);
(*sid_ptr)->type = (char *)GROUPS;
sid_ptr = &(*sid_ptr)->next;
}
LK_ENTRY **linklist_base, int *linklist_count,
char *rFilter)
{
+ LK_ENTRY *pPtr;
char filter[128];
char *attr_array[3];
int rc;
return(rc);
}
}
+ if ((*linklist_count) > 1)
+ {
+ com_err(whoami, 0, "multiple groups with mitMoiraId = %s", MoiraId);
+ pPtr = (*linklist_base);
+ while (pPtr)
+ {
+ com_err(whoami, 0, "groups %s has mitMoiraId = %s", pPtr->value, MoiraId);
+ pPtr = pPtr->next;
+ }
+ linklist_free((*linklist_base));
+ (*linklist_base) = NULL;
+ (*linklist_count) = 0;
+ }
if ((*linklist_count) == 1)
{
strcpy(rFilter, filter);