From 32954eb9e9eb1e3613ad55cb1afd5e19e81b5da8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 11:54:00 +0000 Subject: Makefile: - added nisppass.c and NISPLUS_FLAGS includes.h: - renamed USE_LDAP to USE_LDAP_DB. renamed NISPLUS to USE_NISPLUS_DB. added default define of USE_SMBPASS_DB. - removed ldap headers: they are local only to ldap.c ldap.c : - made all ldap-specific functions static. - added dummy sam21 functions loadparm.c : - renamed NISPLUS to NISPLUS_HOME mkproto.awk - commented out ldap-specific #ifdef generation code: it's not needed now that ldap-specific functions in ldap.c are static nisppass.c : - first attempt at an add function from (This used to be commit f215d375f0f1e12894c2a9e86bd28d4776d337c1) --- source3/passdb/ldap.c | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) (limited to 'source3/passdb/ldap.c') diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c index f0848c2d57..3d584c1c0e 100644 --- a/source3/passdb/ldap.c +++ b/source3/passdb/ldap.c @@ -29,7 +29,7 @@ extern int DEBUGLEVEL; /******************************************************************* open a connection to the ldap serve. ******************************************************************/ -BOOL ldap_open_connection(LDAP **ldap_struct) +static BOOL ldap_open_connection(LDAP **ldap_struct) { if ( (*ldap_struct = ldap_open(lp_ldap_server(),lp_ldap_port()) )== NULL) { @@ -59,7 +59,7 @@ static BOOL ldap_connect_anonymous(LDAP *ldap_struct) /******************************************************************* connect to the ldap server under system privileg. ******************************************************************/ -BOOL ldap_connect_system(LDAP *ldap_struct) +static BOOL ldap_connect_system(LDAP *ldap_struct) { if ( ldap_simple_bind_s(ldap_struct,lp_ldap_root(),lp_ldap_rootpasswd()) != LDAP_SUCCESS) { @@ -107,7 +107,7 @@ static BOOL ldap_search_one_user(LDAP *ldap_struct, char *filter, LDAPMessage ** /******************************************************************* run the search by name. ******************************************************************/ -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, char *user, LDAPMessage **result) { pstring filter; /* @@ -127,7 +127,7 @@ BOOL ldap_search_one_user_by_name(LDAP *ldap_struct, char *user, LDAPMessage **r /******************************************************************* run the search by uid. ******************************************************************/ -BOOL ldap_search_one_user_by_uid(LDAP *ldap_struct, int uid, LDAPMessage **result) +static BOOL ldap_search_one_user_by_uid(LDAP *ldap_struct, int uid, LDAPMessage **result) { pstring filter; /* @@ -146,7 +146,7 @@ BOOL ldap_search_one_user_by_uid(LDAP *ldap_struct, int uid, LDAPMessage **resul /******************************************************************* search an attribute and return the first value found. ******************************************************************/ -void get_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, char *attribute, char *value) +static void get_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, char *attribute, char *value) { char **valeurs; @@ -165,7 +165,7 @@ void get_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, char *attribute /******************************************************************* check if the returned entry is a sambaAccount objectclass. ******************************************************************/ -BOOL ldap_check_user(LDAP *ldap_struct, LDAPMessage *entry) +static BOOL ldap_check_user(LDAP *ldap_struct, LDAPMessage *entry) { BOOL sambaAccount=False; char **valeur; @@ -188,7 +188,7 @@ BOOL ldap_check_user(LDAP *ldap_struct, LDAPMessage *entry) /******************************************************************* check if the returned entry is a sambaMachine objectclass. ******************************************************************/ -BOOL ldap_check_trust(LDAP *ldap_struct, LDAPMessage *entry) +static BOOL ldap_check_trust(LDAP *ldap_struct, LDAPMessage *entry) { BOOL sambaMachine=False; char **valeur; @@ -235,10 +235,10 @@ static void ldap_get_smb_passwd(LDAP *ldap_struct,LDAPMessage *entry, bzero(temp, sizeof(temp)); /* destroy local copy of the password */ #else get_single_attribute(ldap_struct, entry, "ntPasswordHash", temp); - gethexpwd(temp, user->smb_nt_passwd); + pdb_gethexpwd(temp, user->smb_nt_passwd); get_single_attribute(ldap_struct, entry, "lmPasswordHash", temp); - gethexpwd(temp, user->smb_passwd); + pdb_gethexpwd(temp, user->smb_passwd); bzero(temp, sizeof(temp)); /* destroy local copy of the password */ #endif @@ -373,6 +373,18 @@ static void ldap_get_sam_passwd(LDAP *ldap_struct, LDAPMessage *entry, } } +/************************************************************************ + Routine to add an entry to the ldap passwd file. + + do not call this function directly. use passdb.c instead. + +*************************************************************************/ +BOOL add_ldap21pwd_entry(struct smb_passwd *newpwd) +{ + DEBUG(0,("add_ldap21pwd_entry - currently not supported\n")); + return True; +} + /************************************************************************ Routine to add an entry to the ldap passwd file. @@ -402,6 +414,23 @@ BOOL mod_ldappwd_entry(struct smb_passwd* pwd, BOOL override) return False; } +/************************************************************************ + Routine to search the ldap passwd file for an entry matching the username. + and then modify its password entry. We can't use the startldappwent()/ + getldappwent()/endldappwent() interfaces here as we depend on looking + in the actual file to decide how much room we have to write data. + override = False, normal + override = True, override XXXXXXXX'd out password or NO PASS + + do not call this function directly. use passdb.c instead. + +************************************************************************/ +BOOL mod_ldap21pwd_entry(struct smb_passwd* pwd, BOOL override) +{ + DEBUG(0,("mod_ldap21pwd_entry - currently not supported\n")); + return False; +} + /*************************************************************** Start to enumerate the ldap passwd list. Returns a void pointer to ensure no modification outside this module. -- cgit