89 return NULL; |
89 return NULL; |
90 } |
90 } |
91 |
91 |
92 LDAPMessage *msg = ldap_first_entry(ld, result); |
92 LDAPMessage *msg = ldap_first_entry(ld, result); |
93 if (msg) { |
93 if (msg) { |
94 LDAPUser *user = malloc(sizeof (LDAPUser)); |
94 LDAPUser *user = malloc(sizeof(LDAPUser)); |
95 if (user != NULL) { |
95 if (user != NULL) { |
96 user->user.verify_password = ldap_user_verify_password; |
96 user->user.verify_password = ldap_user_verify_password; |
97 user->user.check_group = ldap_user_check_group; |
97 user->user.check_group = ldap_user_check_group; |
98 user->user.free = ldap_user_free; |
98 user->user.free = ldap_user_free; |
99 user->user.name = username; // must not be freed |
99 user->user.name = username; // must not be freed |
|
100 |
|
101 // TODO: get uid/gid from ldap |
|
102 user->user.uid = -1; |
|
103 user->user.gid = -1; |
100 |
104 |
101 user->ldap = ld; |
105 user->ldap = ld; |
102 user->userdn = ldap_get_dn(ld, msg); |
106 user->userdn = ldap_get_dn(ld, msg); |
103 |
107 |
104 ldap_msgfree(result); |
108 ldap_msgfree(result); |