summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-01-19 09:58:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:57 -0500
commit0c6010238d5eda73bbd6b9e81e2261d19bc01bb7 (patch)
tree8c437a049c33cf5504eec9ef303d35bf99ba917c /source3/passdb
parent87965a24259ed99f2e2f168747405fd3c2ffc815 (diff)
downloadsamba-0c6010238d5eda73bbd6b9e81e2261d19bc01bb7.tar.gz
samba-0c6010238d5eda73bbd6b9e81e2261d19bc01bb7.tar.bz2
samba-0c6010238d5eda73bbd6b9e81e2261d19bc01bb7.zip
r4840: * Add more generic root-dse inspection function to check for given
controls or extensions. * Check and remember if ldapsam's LDAP Server support paged results (in preparation of adding async paged-results to set|get|end-sampwent in ldapsam). Guenther (This used to be commit ced58bd8849cdef78513674dff1b1ec331945aa9)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c59
1 files changed, 1 insertions, 58 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 6c1d64abce..ee0cb260e8 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -782,8 +782,6 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state,
pdb_set_hours_len(sampass, hours_len, PDB_SET);
pdb_set_logon_divs(sampass, logon_divs, PDB_SET);
-/* pdb_set_munged_dial(sampass, munged_dial, PDB_SET); */
-
if (!smbldap_get_single_pstring(ldap_state->smbldap_state->ldap_struct, entry,
get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_BAD_PASSWORD_COUNT), temp)) {
/* leave as default */
@@ -1409,62 +1407,7 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
static BOOL ldapsam_can_pwchange_exop(struct smbldap_state *ldap_state)
{
- LDAPMessage *msg = NULL;
- LDAPMessage *entry = NULL;
- char **values = NULL;
- char *attrs[] = { "supportedExtension", NULL };
- int rc, num_result, num_values, i;
- BOOL result = False;
-
- rc = smbldap_search(ldap_state, "", LDAP_SCOPE_BASE, "(objectclass=*)",
- attrs, 0, &msg);
-
- if (rc != LDAP_SUCCESS) {
- DEBUG(3, ("Could not search rootDSE\n"));
- return False;
- }
-
- num_result = ldap_count_entries(ldap_state->ldap_struct, msg);
-
- if (num_result != 1) {
- DEBUG(3, ("Expected one rootDSE, got %d\n", num_result));
- goto done;
- }
-
- entry = ldap_first_entry(ldap_state->ldap_struct, msg);
-
- if (entry == NULL) {
- DEBUG(3, ("Could not retrieve rootDSE\n"));
- goto done;
- }
-
- values = ldap_get_values(ldap_state->ldap_struct, entry,
- "supportedExtension");
-
- if (values == NULL) {
- DEBUG(9, ("LDAP Server does not support any extensions\n"));
- goto done;
- }
-
- num_values = ldap_count_values(values);
-
- if (num_values == 0) {
- DEBUG(9, ("LDAP Server does not support any extensions\n"));
- goto done;
- }
-
- for (i=0; i<num_values; i++) {
- if (strcmp(values[i], LDAP_EXOP_MODIFY_PASSWD) == 0)
- result = True;
- }
-
- done:
- if (values != NULL)
- ldap_value_free(values);
- if (msg != NULL)
- ldap_msgfree(msg);
-
- return result;
+ return smbldap_has_extension(ldap_state, LDAP_EXOP_MODIFY_PASSWD);
}
/********************************************************************