diff options
author | Simo Sorce <idra@samba.org> | 2001-12-31 16:01:04 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-12-31 16:01:04 +0000 |
commit | 7a3cac39a5cbbadcd31d30058d3b513725aa2fa0 (patch) | |
tree | 11408442c5654957106ab821fe2e4c7e8ea06de1 | |
parent | f30dd2ec5b4b7607f2af04ccb8ad1c8f2a08de1b (diff) | |
download | samba-7a3cac39a5cbbadcd31d30058d3b513725aa2fa0.tar.gz samba-7a3cac39a5cbbadcd31d30058d3b513725aa2fa0.tar.bz2 samba-7a3cac39a5cbbadcd31d30058d3b513725aa2fa0.zip |
ops, froget to set the values.
jerry, can you look at theis where we use standard_sub_advanced() fns?
I think this structure should be backported to 2.2 because we do not know if the SAM_ACCOUNT strings have enough space to contain the "substituted" string.
(Yes, just now we know they are pstrings, but we may change them into alloced one, I'm a strong suported of alloced strings as 1024 bytes are not always enough and are often too much)
(This used to be commit 29b3b5e9292805aa65e887755567abd50f74e5cb)
-rw-r--r-- | source3/passdb/pdb_tdb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index 69b2aab229..ca6a2361d7 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -486,10 +486,13 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user) sam_user = pdb_get_username(user); pstrcpy(sam_subst, pdb_get_logon_script(user)); standard_sub_advanced(-1, sam_user, "", gid, sam_user, sam_subst); + pdb_set_logon_script(user, sam_subst, True); pstrcpy(sam_subst, pdb_get_profile_path(user)); standard_sub_advanced(-1, pdb_get_username(user), "", gid, pdb_get_username(user), sam_subst); + pdb_set_profile_path(user, sam_subst, True); pstrcpy(sam_subst, pdb_get_homedir(user)); standard_sub_advanced(-1, pdb_get_username(user), "", gid, pdb_get_username(user), sam_subst); + pdb_set_homedir(user, sam_subst, True); /* increment to next in line */ global_tdb_ent.key = tdb_nextkey(global_tdb_ent.passwd_tdb, global_tdb_ent.key); @@ -512,7 +515,7 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, const char *sname) uid_t uid; gid_t gid; - char *sam_user; + const char *sam_user; pstring sam_subst; if (user==NULL) { @@ -573,10 +576,13 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, const char *sname) sam_user = pdb_get_username(user); pstrcpy(sam_subst, pdb_get_logon_script(user)); standard_sub_advanced(-1, sam_user, "", gid, sam_user, sam_subst); + pdb_set_logon_script(user, sam_subst, True); pstrcpy(sam_subst, pdb_get_profile_path(user)); standard_sub_advanced(-1, pdb_get_username(user), "", gid, pdb_get_username(user), sam_subst); + pdb_set_profile_path(user, sam_subst, True); pstrcpy(sam_subst, pdb_get_homedir(user)); standard_sub_advanced(-1, pdb_get_username(user), "", gid, pdb_get_username(user), sam_subst); + pdb_set_homedir(user, sam_subst, True); } else { DEBUG(0,("pdb_getsampwent: getpwnam(%s) return NULL. User does not exist!\n", |