Commit b3d82e99 b3d82e9958dc597e644d04efa6e5e38ea5f0da74 by Sergey Poznyakoff

Bugfix

* libmu_auth/ldap.c (_construct_attr_array)
(_mu_entry_to_auth_data): Fix types of iterator return values.
1 parent d91e8458
...@@ -442,9 +442,9 @@ _construct_attr_array (size_t *pargc, char ***pargv) ...@@ -442,9 +442,9 @@ _construct_attr_array (size_t *pargc, char ***pargv)
442 for (i = 0, mu_iterator_first (itr); !mu_iterator_is_done (itr); 442 for (i = 0, mu_iterator_first (itr); !mu_iterator_is_done (itr);
443 mu_iterator_next (itr), i++) 443 mu_iterator_next (itr), i++)
444 { 444 {
445 char **str; 445 char *str;
446 mu_iterator_current (itr, (void**) &str); 446 mu_iterator_current (itr, (void**) &str);
447 if ((argv[i] = strdup (*str)) == NULL) 447 if ((argv[i] = strdup (str)) == NULL)
448 { 448 {
449 mu_argcv_free (i, argv); 449 mu_argcv_free (i, argv);
450 return ENOMEM; 450 return ENOMEM;
...@@ -545,17 +545,15 @@ _mu_entry_to_auth_data (LDAP *ld, LDAPMessage *msg, ...@@ -545,17 +545,15 @@ _mu_entry_to_auth_data (LDAP *ld, LDAPMessage *msg,
545 mu_iterator_next (itr)) 545 mu_iterator_next (itr))
546 { 546 {
547 char *key; 547 char *key;
548 char **pattr;
549 char *attr; 548 char *attr;
550 struct berval **values; 549 struct berval **values;
551 550
552 mu_iterator_current_kv (itr, (const void **)&key, (void**) &pattr); 551 mu_iterator_current_kv (itr, (const void **)&key, (void**) &attr);
553 attr = *pattr;
554 values = ldap_get_values_len (ld, msg, attr); 552 values = ldap_get_values_len (ld, msg, attr);
555 if (!values || !values[0]) 553 if (!values || !values[0])
556 { 554 {
557 mu_error ("LDAP field `%s' (`%s') has NULL value", 555 mu_error ("LDAP field `%s' (`%s') has NULL value",
558 key, *pattr); 556 key, attr);
559 _free_partial_auth_data (&d); 557 _free_partial_auth_data (&d);
560 return MU_ERR_READ; 558 return MU_ERR_READ;
561 } 559 }
...@@ -637,7 +635,7 @@ _mu_ldap_search (LDAP *ld, const char *filter_pat, const char *key, ...@@ -637,7 +635,7 @@ _mu_ldap_search (LDAP *ld, const char *filter_pat, const char *key,
637 return MU_ERR_FAILURE; 635 return MU_ERR_FAILURE;
638 } 636 }
639 637
640 rc = ldap_result (ld, msgid, LDAP_MSG_ALL, NULL, &res ); 638 rc = ldap_result (ld, msgid, LDAP_MSG_ALL, NULL, &res);
641 if (rc < 0) 639 if (rc < 0)
642 { 640 {
643 mu_error ("ldap_result failed"); 641 mu_error ("ldap_result failed");
......