summaryrefslogtreecommitdiff
path: root/source/passdb/ldap.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-05-18 14:55:17 +0000
committerLuke Leighton <lkcl@samba.org>1998-05-18 14:55:17 +0000
commit98ab085b93fb25a4d9275c0d54a863fd9fae2548 (patch)
treee26a8c9a4a06c569089d6d21c3f6efa5cb3ae44b /source/passdb/ldap.c
parent8082239c81dfed5e3cc34a4d0a4e7195398ae627 (diff)
downloadsamba-98ab085b93fb25a4d9275c0d54a863fd9fae2548.tar.gz
creating and using some pdb_init_(sam/smb) routines. putting ldap headers
back in (they had been taken out of includes.h because they are only local to ldap.c.
Diffstat (limited to 'source/passdb/ldap.c')
-rw-r--r--source/passdb/ldap.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/source/passdb/ldap.c b/source/passdb/ldap.c
index 9693ab1e731..6d4d2f8dcfb 100644
--- a/source/passdb/ldap.c
+++ b/source/passdb/ldap.c
@@ -24,8 +24,8 @@
#include "includes.h"
-#include <ldap.h>
#include <lber.h>
+#include <ldap.h>
#define ADD_USER 1
#define MODIFY_USER 2
@@ -223,11 +223,7 @@ static void ldap_get_smb_passwd(LDAP *ldap_struct,LDAPMessage *entry,
static unsigned char smblmpwd[16];
static unsigned char smbntpwd[16];
- user->smb_name = NULL;
- user->smb_passwd = NULL;
- user->smb_nt_passwd = NULL;
- user->smb_userid = 0;
- user->pass_last_set_time = (time_t)-1;
+ pdb_init_smb(user);
bzero(smblmpwd, sizeof(smblmpwd));
bzero(smbntpwd, sizeof(smbntpwd));
@@ -292,16 +288,11 @@ static void ldap_get_sam_passwd(LDAP *ldap_struct, LDAPMessage *entry,
static pstring temp;
static struct smb_passwd pw_buf;
+ pdb_init_sam(user);
+
ldap_get_smb_passwd(ldap_struct, entry, &pw_buf);
- bzero(user, sizeof(*user));
-
- user->logon_time = (time_t)-1;
- user->logoff_time = (time_t)-1;
- user->kickoff_time = (time_t)-1;
user->pass_last_set_time = pw_buf.pass_last_set_time;
- user->pass_can_change_time = (time_t)-1;
- user->pass_must_change_time = (time_t)-1;
get_single_attribute(ldap_struct, entry, "logonTime", temp);
user->pass_last_set_time = (time_t)strtol(temp, NULL, 16);