The substitution of %U and %D in the 'template homedir' is nowdone
authorTim Potter <tpot@samba.org>
Tue, 8 May 2001 05:58:03 +0000 (05:58 +0000)
committerTim Potter <tpot@samba.org>
Tue, 8 May 2001 05:58:03 +0000 (05:58 +0000)
by lp_string() calling standard_sub_basic().

source/nsswitch/winbindd_user.c

index 95830ead20aaa34efca7f5cab99bb3b7cbfebf5c..f23593db887a0ca8e50e06a76e1bcf8a471311b9 100644 (file)
@@ -29,6 +29,7 @@ static BOOL winbindd_fill_pwent(char *domain_name, char *name,
                                uint32 user_rid, uint32 group_rid, 
                                 char *full_name, struct winbindd_pw *pw)
 {
+       extern userdom_struct current_user_info;
        fstring name_domain, name_user;
        pstring homedir;
        
@@ -66,18 +67,13 @@ static BOOL winbindd_fill_pwent(char *domain_name, char *name,
        
        parse_domain_user(name, name_domain, name_user);
        
-       pstrcpy(homedir, lp_template_homedir());
-       
-       /*
-        * Insist name_user is lowercase, name_domain is uppercase.
-        * This is a hack. JRA.
-        */
+       /* The substitution of %U and %D in the 'template homedir' is done
+          by lp_string() calling standard_sub_basic(). */
 
-       strlower(name_user);
-       strupper(name_domain);
+       fstrcpy(current_user_info.smb_name, name_user);
+       fstrcpy(current_user_info.domain, name_domain);
 
-       pstring_sub(homedir, "%U", name_user);
-       pstring_sub(homedir, "%D", name_domain);
+       pstrcpy(homedir, lp_template_homedir());
        
        safe_strcpy(pw->pw_dir, homedir, sizeof(pw->pw_dir) - 1);