summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-03-01 03:12:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:17 -0500
commitaaa3a9a329b2a47c44b3a26baabdfe0668224ffe (patch)
tree9258fb282081f28a4e02c0a94dae6afa612dc759 /source3/nsswitch
parent2c51e492f9961277c27099e6beaa431db2acc6d1 (diff)
downloadsamba-aaa3a9a329b2a47c44b3a26baabdfe0668224ffe.tar.gz
samba-aaa3a9a329b2a47c44b3a26baabdfe0668224ffe.tar.bz2
samba-aaa3a9a329b2a47c44b3a26baabdfe0668224ffe.zip
r21613: perform variable subsitution on home directories and shells provided by the nss_info backend
(This used to be commit a9028612a3f614579b28f9560cc67aef90b31cf8)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_user.c25
1 files changed, 13 insertions, 12 deletions
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;