From: Gerald Carter Date: Thu, 1 Mar 2007 03:12:16 +0000 (+0000) Subject: r21613: perform variable subsitution on home directories and shells provided by the... X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~1034 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9028612a3f614579b28f9560cc67aef90b31cf8;p=thirdparty%2Fsamba.git r21613: perform variable subsitution on home directories and shells provided by the nss_info backend --- diff --git a/source/nsswitch/winbindd_user.c b/source/nsswitch/winbindd_user.c index 9df3a6a3bc1..47a7364e3a7 100644 --- a/source/nsswitch/winbindd_user.c +++ b/source/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;