diff options
author | Matthew Chapman <matty@samba.org> | 1999-09-22 04:32:19 +0000 |
---|---|---|
committer | Matthew Chapman <matty@samba.org> | 1999-09-22 04:32:19 +0000 |
commit | 740d8388cb6dfebb26681a45fd1b293383d08a6d (patch) | |
tree | c7e07ff11dc85c000b9268aadc98e47088ea6d55 /source/passdb | |
parent | d99eca020a255022dbc71f3671127343d75db59e (diff) | |
download | samba-740d8388cb6dfebb26681a45fd1b293383d08a6d.tar.gz samba-740d8388cb6dfebb26681a45fd1b293383d08a6d.tar.xz samba-740d8388cb6dfebb26681a45fd1b293383d08a6d.zip |
Fixed an annoying bug in the LDAP code. Attributes not present in the
LDAP database were being initialised using unix_to_nt_time on -1, rather
than -1 as an NTTIME (which is very different).
Problems solved (hopefully):
* "Access Denied" when accessing an NT share in a Samba controlled domain.
* "Your password has expired" sometimes when logging in.
Diffstat (limited to 'source/passdb')
-rw-r--r-- | source/passdb/sampassldap.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/source/passdb/sampassldap.c b/source/passdb/sampassldap.c index e456b6ab435..fd503c3d27c 100644 --- a/source/passdb/sampassldap.c +++ b/source/passdb/sampassldap.c @@ -83,11 +83,10 @@ static void ldap_read_time(char *attribute, NTTIME *nttime) time_t t; if(ldap_get_attribute(attribute, timestr)) + { t = (time_t)strtol(timestr, NULL, 16); - else - t = (time_t)(-1); - - unix_to_nt_time(nttime, t); + unix_to_nt_time(nttime, t); + } } @@ -116,48 +115,30 @@ static struct sam_passwd *ldapsam_getsam() if(ldap_get_attribute("gidNumber", temp)) sam21->unix_gid = atoi(temp); - else - sam21->unix_gid = (gid_t)(-1); if(ldap_get_attribute("grouprid", temp)) sam21->group_rid = strtol(temp, NULL, 16); - else - sam21->group_rid = 0xFFFFFFFF; if(ldap_get_attribute("cn", full_name)) sam21->full_name = full_name; - else - sam21->full_name = NULL; if(ldap_get_attribute("description", acct_desc)) sam21->acct_desc = acct_desc; - else - sam21->acct_desc = NULL; if(ldap_get_attribute("smbHome", home_dir)) sam21->home_dir = home_dir; - else - sam21->home_dir = NULL; if(ldap_get_attribute("homeDrive", home_drive)) sam21->dir_drive = home_drive; - else - sam21->dir_drive = NULL; if(ldap_get_attribute("script", logon_script)) sam21->logon_script = logon_script; - else - sam21->logon_script = NULL; if(ldap_get_attribute("profile", profile_path)) sam21->profile_path = profile_path; - else - sam21->profile_path = NULL; if(ldap_get_attribute("workstations", workstations)) sam21->workstations = workstations; - else - sam21->workstations = NULL; ldap_read_time("pwdCanChange", &sam21->pass_can_change_time); ldap_read_time("pwdMustChange", &sam21->pass_must_change_time); |