summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-05-25 07:17:38 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-05-25 07:17:38 +0000
commit9921fd9d0ef9a8862b371eec17d47a9e78c5ad67 (patch)
tree4eb1b48ecb595220ffd7e4abb9c3c16a1f604a32
parent8dafae76cd3acc8e052aefb02f4699199ae56009 (diff)
downloadsamba-9921fd9d0ef9a8862b371eec17d47a9e78c5ad67.tar.gz
samba-9921fd9d0ef9a8862b371eec17d47a9e78c5ad67.tar.bz2
samba-9921fd9d0ef9a8862b371eec17d47a9e78c5ad67.zip
Only reterive the attributes we are actually going to use - rather than
the whole record which could include things like photos's etc. Andrew Bartlett (This used to be commit bbc69545516f29cc4e05ba6238b03eb504f28226)
-rw-r--r--source3/passdb/pdb_ldap.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 55ce8bab36..70f130c0a3 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -136,6 +136,17 @@ static BOOL fetch_ldapsam_pw(char **dn, char** pw)
return True;
}
+char *attr[] = {"uid", "pwdLastSet", "logonTime",
+ "logoffTime", "kickoffTime", "cn",
+ "pwdCanChange", "pwdMustChange",
+ "dislplayName", "homeDrive",
+ "smbHome", "scriptPath",
+ "profilePath", "description",
+ "userWorkstation", "rid",
+ "primaryGroupID", "lmPassword",
+ "ntPassword", "acctFlags",
+ "domain", "description", NULL };
+
/*******************************************************************
open a connection to the ldap server.
******************************************************************/
@@ -326,7 +337,7 @@ static int ldapsam_search_one_user (struct ldapsam_privates *ldap_state, LDAP *
DEBUG(2, ("ldapsam_search_one_user: searching for:[%s]\n", filter));
- rc = ldap_search_s(ldap_struct, lp_ldap_suffix (), scope, filter, NULL, 0, result);
+ rc = ldap_search_s(ldap_struct, lp_ldap_suffix (), scope, filter, attr, 0, result);
if (rc != LDAP_SUCCESS) {
DEBUG(0,("ldapsam_search_one_user: Problem during the LDAP search: %s\n",
@@ -995,7 +1006,7 @@ static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state, LDAP *ldap
DEBUG(2, ("ldapsam_get_next_available_nua_rid: searching for:[%s]\n", final_filter));
rc = ldap_search_s(ldap_struct, lp_ldap_suffix(),
- LDAP_SCOPE_SUBTREE, final_filter, NULL, 0,
+ LDAP_SCOPE_SUBTREE, final_filter, attr, 0,
&result);
if (rc != LDAP_SUCCESS)
@@ -1089,7 +1100,7 @@ static BOOL ldapsam_setsampwent(struct pdb_methods *my_methods, BOOL update)
all_string_sub(filter, "%u", "*", sizeof(pstring));
rc = ldap_search_s(ldap_state->ldap_struct, lp_ldap_suffix(),
- LDAP_SCOPE_SUBTREE, filter, NULL, 0,
+ LDAP_SCOPE_SUBTREE, filter, attr, 0,
&ldap_state->result);
if (rc != LDAP_SUCCESS)