From aaa3a9a329b2a47c44b3a26baabdfe0668224ffe Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 1 Mar 2007 03:12:16 +0000 Subject: r21613: perform variable subsitution on home directories and shells provided by the nss_info backend (This used to be commit a9028612a3f614579b28f9560cc67aef90b31cf8) --- source3/nsswitch/winbindd_user.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source3') diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index 9df3a6a3bc..47a7364e3a 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -41,20 +41,21 @@ static BOOL fillup_pw_field(const char *lp_template, if (out == NULL) return False; - if ( in && !strequal(in,"") && lp_security() == SEC_ADS ) { - safe_strcpy(out, in, sizeof(fstring) - 1); - return True; - } - - /* Home directory and shell - use template config parameters. The - defaults are /tmp for the home directory and /bin/false for - shell. */ - - /* The substitution of %U and %D in the 'template homedir' is done - by talloc_sub_specified() below. */ + /* The substitution of %U and %D in the 'template + homedir' is done by talloc_sub_specified() below. + If we have an in string (which means the value has already + been set in the nss_info backend), then use that. + Otherwise use the template value passed in. */ - templ = talloc_sub_specified(NULL, lp_template, username, domname, + if ( in && !strequal(in,"") && lp_security() == SEC_ADS ) { + templ = talloc_sub_specified(NULL, in, + username, domname, uid, gid); + } else { + templ = talloc_sub_specified(NULL, lp_template, + username, domname, + uid, gid); + } if (!templ) return False; -- cgit