summaryrefslogtreecommitdiff
path: root/source3/passdb/ldap.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-10-29 07:35:11 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-10-29 07:35:11 +0000
commitd9d7f023d8d11943ca0375e1573e6ec9921889bc (patch)
tree05cc98ee549f6d8d52711172c6fdcd3564d7ef55 /source3/passdb/ldap.c
parent2038649e51f48a489aeec49947e1b791f0b3df43 (diff)
downloadsamba-d9d7f023d8d11943ca0375e1573e6ec9921889bc.tar.gz
samba-d9d7f023d8d11943ca0375e1573e6ec9921889bc.tar.bz2
samba-d9d7f023d8d11943ca0375e1573e6ec9921889bc.zip
This commit is number 4 of 4.
In particular this commit focuses on: Actually adding the 'const' to the passdb interface, and the flow-on changes. Also kill off the 'disp_info' stuff, as its no longer used. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes introduces a large dose of 'const' to the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username --- This finishes this line of commits off, your tree should now compile again :-) Andrew Bartlett (This used to be commit c95f5aeb9327347674589ae313b75bee3bf8e317)
Diffstat (limited to 'source3/passdb/ldap.c')
-rw-r--r--source3/passdb/ldap.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c
index 753663a09c..e0ac013fc8 100644
--- a/source3/passdb/ldap.c
+++ b/source3/passdb/ldap.c
@@ -77,7 +77,7 @@ static BOOL ldap_connect_system(LDAP *ldap_struct)
/*******************************************************************
connect to the ldap server under a particular user.
******************************************************************/
-static BOOL ldap_connect_user(LDAP *ldap_struct, char *user, char *password)
+static BOOL ldap_connect_user(LDAP *ldap_struct, const char *user, const char *password)
{
if ( ldap_simple_bind_s(ldap_struct,lp_ldap_root(),lp_ldap_rootpasswd()) ! = LDAP_SUCCESS)
{
@@ -111,7 +111,7 @@ static BOOL ldap_search_one_user(LDAP *ldap_struct, char *filter, LDAPMessage **
/*******************************************************************
run the search by name.
******************************************************************/
-static BOOL ldap_search_one_user_by_name(LDAP *ldap_struct, char *user, LDAPMessage **result)
+static BOOL ldap_search_one_user_by_name(LDAP *ldap_struct, const char *user, LDAPMessage **result)
{
pstring filter;
/*
@@ -374,7 +374,7 @@ static void ldap_get_sam_passwd(LDAP *ldap_struct, LDAPMessage *entry,
manage memory used by the array, by each struct, and values
************************************************************************/
-static void make_a_mod(LDAPMod ***modlist,int modop, char *attribute, char *value)
+static void make_a_mod(LDAPMod ***modlist,int modop, const char *attribute, const char *value)
{
LDAPMod **mods, **tmods;
int i;
@@ -980,21 +980,6 @@ static BOOL del_ldappwd_entry(const char *name)
return False; /* Dummy... */
}
-static struct sam_disp_info *getldapdispnam(char *name)
-{
- return pdb_sam_to_dispinfo(getldap21pwnam(name));
-}
-
-static struct sam_disp_info *getldapdisprid(uint32 rid)
-{
- return pdb_sam_to_dispinfo(getldap21pwrid(rid));
-}
-
-static struct sam_disp_info *getldapdispent(void *vp)
-{
- return pdb_sam_to_dispinfo(getldap21pwent(vp));
-}
-
static struct sam_passwd *getldap21pwuid(uid_t uid)
{
return pdb_smb_to_sam(iterate_getsam21pwuid(pdb_uid_to_user_rid(uid)));
@@ -1018,10 +1003,7 @@ static struct passdb_ops ldap_ops =
iterate_getsam21pwuid, /* From passdb.c */
iterate_getsam21pwrid, /* From passdb.c */
add_ldap21pwd_entry,
- mod_ldap21pwd_entry,
- getldapdispnam,
- getldapdisprid,
- getldapdispent
+ mod_ldap21pwd_entry
};
struct passdb_ops *ldap_initialize_password_db(void)