diff options
author | Gerald Carter <jerry@samba.org> | 2003-12-04 04:52:49 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-12-04 04:52:49 +0000 |
commit | c6f0190b5418b1ee02fdd45b7c6e3ce560b834b8 (patch) | |
tree | 6155b7d4eaaa1c0601154ad7c2d2fe2ba5514281 /source3/passdb/pdb_ldap.c | |
parent | 555ef2d5cfab6b5cac69f943d5ea870dd0c94423 (diff) | |
download | samba-c6f0190b5418b1ee02fdd45b7c6e3ce560b834b8.tar.gz samba-c6f0190b5418b1ee02fdd45b7c6e3ce560b834b8.tar.bz2 samba-c6f0190b5418b1ee02fdd45b7c6e3ce560b834b8.zip |
support munged dial for ldapsam; patch from Aurélien Degrémont; bug 800
(This used to be commit acf9eae7b0c95776358292c3463951477575bcc6)
Diffstat (limited to 'source3/passdb/pdb_ldap.c')
-rw-r--r-- | source3/passdb/pdb_ldap.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 023e9f3fe0..4d7c7791bd 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -415,8 +415,8 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, logon_script, profile_path, acct_desc, - munged_dial, workstations; + char munged_dial[2048]; uint32 user_rid; uint8 smblmpwd[LM_HASH_LEN], smbntpwd[NT_HASH_LEN]; @@ -660,6 +660,13 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_workstations(sampass, workstations, PDB_SET); } + if (!smbldap_get_single_attribute(ldap_state->smbldap_state->ldap_struct, entry, + get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_MUNGED_DIAL), munged_dial)) { + /* leave as default */; + } else { + pdb_set_munged_dial(sampass, munged_dial, PDB_SET); + } + /* FIXME: hours stuff should be cleaner */ logon_divs = 168; @@ -703,7 +710,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_hours_len(sampass, hours_len, PDB_SET); pdb_set_logon_divs(sampass, logon_divs, PDB_SET); - pdb_set_munged_dial(sampass, munged_dial, PDB_SET); +/* pdb_set_munged_dial(sampass, munged_dial, PDB_SET); */ /* pdb_set_unknown_3(sampass, unknown3, PDB_SET); */ @@ -851,7 +858,12 @@ static BOOL init_ldap_from_sam (struct ldapsam_privates *ldap_state, smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_WKS), pdb_get_workstations(sampass)); - + + if (need_update(sampass, PDB_MUNGEDDIAL)) + smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods, + get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_MUNGED_DIAL), + pdb_get_munged_dial(sampass)); + if (need_update(sampass, PDB_SMBHOME)) smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_HOME_PATH), |