summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_ldap.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-01-19 22:50:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:54:00 -0500
commit811df6699c76a2d6f7561efc27c1bdfa0a8d5c4d (patch)
tree1072ce90b5948adb666a535da51db29847efb414 /source3/passdb/pdb_ldap.c
parent372440f207d88e058af76cf7ce4c5901ba7a7547 (diff)
downloadsamba-811df6699c76a2d6f7561efc27c1bdfa0a8d5c4d.tar.gz
samba-811df6699c76a2d6f7561efc27c1bdfa0a8d5c4d.tar.bz2
samba-811df6699c76a2d6f7561efc27c1bdfa0a8d5c4d.zip
r4860: fix silly limitation in ldapsam and tdbsam. Expand variables in the profile path, logon home and logon script values
(This used to be commit 504ea4ac68f47b71542a88b17cbb6b546e1cb881)
Diffstat (limited to 'source3/passdb/pdb_ldap.c')
-rw-r--r--source3/passdb/pdb_ldap.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 0c6e59b2fc..8b7661d9a3 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -476,6 +476,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state,
pstring temp;
LOGIN_CACHE *cache_entry = NULL;
int pwHistLen;
+ pstring tmpstring;
/*
* do a little initialization
@@ -635,9 +636,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state,
if (!smbldap_get_single_pstring(ldap_state->smbldap_state->ldap_struct, entry,
get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_HOME_DRIVE), dir_drive))
{
- pdb_set_dir_drive( sampass,
- talloc_sub_basic(sampass->mem_ctx, username, lp_logon_drive()),
- PDB_DEFAULT );
+ pdb_set_dir_drive( sampass, lp_logon_drive(), PDB_DEFAULT );
} else {
pdb_set_dir_drive(sampass, dir_drive, PDB_SET);
}
@@ -649,7 +648,9 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state,
talloc_sub_basic(sampass->mem_ctx, username, lp_logon_home()),
PDB_DEFAULT );
} else {
- pdb_set_homedir(sampass, homedir, PDB_SET);
+ pstrcpy( tmpstring, homedir );
+ standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+ pdb_set_homedir(sampass, tmpstring, PDB_SET);
}
if (!smbldap_get_single_pstring(ldap_state->smbldap_state->ldap_struct, entry,
@@ -659,7 +660,9 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state,
talloc_sub_basic(sampass->mem_ctx, username, lp_logon_script()),
PDB_DEFAULT );
} else {
- pdb_set_logon_script(sampass, logon_script, PDB_SET);
+ pstrcpy( tmpstring, logon_script );
+ standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+ pdb_set_logon_script(sampass, tmpstring, PDB_SET);
}
if (!smbldap_get_single_pstring(ldap_state->smbldap_state->ldap_struct, entry,
@@ -669,7 +672,9 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state,
talloc_sub_basic( sampass->mem_ctx, username, lp_logon_path()),
PDB_DEFAULT );
} else {
- pdb_set_profile_path(sampass, profile_path, PDB_SET);
+ pstrcpy( tmpstring, profile_path );
+ standard_sub_basic( username, tmpstring, sizeof(tmpstring) );
+ pdb_set_profile_path(sampass, tmpstring, PDB_SET);
}
if (!smbldap_get_single_pstring(ldap_state->smbldap_state->ldap_struct, entry,