]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r21613: perform variable subsitution on home directories and shells provided by the...
authorGerald Carter <jerry@samba.org>
Thu, 1 Mar 2007 03:12:16 +0000 (03:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:17 +0000 (12:18 -0500)
source/nsswitch/winbindd_user.c

index 9df3a6a3bc1882560b7c69bf75ca30022a3a704f..47a7364e3a7910310fc587f11ac3898efadfe96c 100644 (file)
@@ -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;