summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-10-10 17:04:23 +0000
committerGerald Carter <jerry@samba.org>2001-10-10 17:04:23 +0000
commit1347bd6057f664fcd827e91b639cc55280d8fa77 (patch)
tree4b8e3d4acb3c2f841a84fbefaa8a90d048c5cc70 /source3/passdb
parente1e689debc76f3029dabdf30c20b6cd831273128 (diff)
downloadsamba-1347bd6057f664fcd827e91b639cc55280d8fa77.tar.gz
samba-1347bd6057f664fcd827e91b639cc55280d8fa77.tar.bz2
samba-1347bd6057f664fcd827e91b639cc55280d8fa77.zip
merge from 2.2
(This used to be commit 96c9df577bcffeec1b7d516a5431e54e679bd6b4)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index a737b5896b..d44a6133f3 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -371,10 +371,7 @@ static BOOL init_sam_from_ldap (SAM_ACCOUNT * sampass,
get_single_attribute(ldap_struct, entry, "uid", username);
DEBUG(2, ("Entry found for user: %s\n", username));
- /* not sure about this for nt_username */
- get_single_attribute (ldap_struct, entry, "sAMAccountName", nt_username);
- if (!nt_username)
- pstrcpy(nt_username, username);
+ pstrcpy(nt_username, username);
get_single_attribute(ldap_struct, entry, "sambaDomain", domain);
if (!domain)
@@ -412,11 +409,35 @@ static BOOL init_sam_from_ldap (SAM_ACCOUNT * sampass,
}
get_single_attribute(ldap_struct, entry, "homeDrive", dir_drive);
+ DEBUG(5,("homeDrive is set to %s\n",dir_drive));
+ if (!*dir_drive) {
+ pstrcpy(dir_drive, lp_logon_drive());
+ DEBUG(5,("homeDrive fell back to %s\n",dir_drive));
+ }
+
+ get_single_attribute(ldap_struct, entry, "smbHome", homedir);
+ DEBUG(5,("smbHome is set to %s\n",homedir));
+ if (!*homedir) {
+ pstrcpy(homedir, lp_logon_home());
+ DEBUG(5,("smbHome fell back to %s\n",homedir));
+ }
+
get_single_attribute(ldap_struct, entry, "scriptPath", logon_script);
+ DEBUG(5,("scriptPath is set to %s\n",logon_script));
+ if (!*logon_script) {
+ pstrcpy(logon_script, lp_logon_script());
+ DEBUG(5,("scriptPath fell back to %s\n",logon_script));
+ }
+
get_single_attribute(ldap_struct, entry, "profilePath", profile_path);
- get_single_attribute(ldap_struct, entry, "description", acct_desc);
- get_single_attribute (ldap_struct, entry, "userWorkstations", workstations);
+ DEBUG(5,("profilePath is set to %s\n",profile_path));
+ if (!*profile_path) {
+ pstrcpy(profile_path, lp_logon_path());
+ DEBUG(5,("profilePath fell back to %s\n",profile_path));
+ }
+ get_single_attribute(ldap_struct, entry, "description", acct_desc);
+ get_single_attribute(ldap_struct, entry, "userWorkstations", workstations);
get_single_attribute(ldap_struct, entry, "rid", temp);
user_rid = (uint32)strtol(temp, NULL, 16);
get_single_attribute(ldap_struct, entry, "primaryGroupID", temp);
@@ -432,7 +453,6 @@ static BOOL init_sam_from_ldap (SAM_ACCOUNT * sampass,
sys_user = sys_getpwnam(username);
if (sys_user == NULL)
return False;
- pstrcpy(homedir, sys_user->pw_dir);
/* FIXME: hours stuff should be cleaner */
@@ -484,8 +504,10 @@ static BOOL init_sam_from_ldap (SAM_ACCOUNT * sampass,
pdb_set_acct_desc(sampass, acct_desc);
pdb_set_workstations(sampass, workstations);
pdb_set_munged_dial(sampass, munged_dial);
- pdb_set_nt_passwd(sampass, smbntpwd);
- pdb_set_lanman_passwd(sampass, smblmpwd);
+ if (!pdb_set_nt_passwd(sampass, smbntpwd))
+ return False;
+ if (!pdb_set_lanman_passwd(sampass, smblmpwd))
+ return False;
/* pdb_set_unknown_3(sampass, unknown3); */
/* pdb_set_unknown_5(sampass, unknown5); */
@@ -516,7 +538,6 @@ static BOOL init_ldap_from_sam (LDAPMod *** mods, int ldap_state, SAM_ACCOUNT *
DEBUG(2, ("Setting entry for user: %s\n", pdb_get_username(sampass)));
/* not sure about using this for the nt_username */
- make_a_mod (mods, ldap_state, "sAMAccountName", pdb_get_nt_username(sampass));
make_a_mod(mods, ldap_state, "sambaDomain", pdb_get_domain(sampass));
slprintf(temp, sizeof(temp) - 1, "%i", pdb_get_uid(sampass));
@@ -549,7 +570,7 @@ static BOOL init_ldap_from_sam (LDAPMod *** mods, int ldap_state, SAM_ACCOUNT *
make_a_mod(mods, ldap_state, "displayName", pdb_get_fullname(sampass));
make_a_mod(mods, ldap_state, "cn", pdb_get_fullname(sampass));
- make_a_mod(mods, ldap_state, "homeDirectory", pdb_get_homedir(sampass));
+ make_a_mod(mods, ldap_state, "smbHome", pdb_get_homedir(sampass));
make_a_mod(mods, ldap_state, "homeDrive", pdb_get_dirdrive(sampass));
make_a_mod(mods, ldap_state, "scriptPath", pdb_get_logon_script(sampass));
make_a_mod(mods, ldap_state, "profilePath", pdb_get_profile_path(sampass));