[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Wed Feb 5 05:48:04 MST 2014


The branch, master has been updated
       via  0ce4631 winbind3: Simplify fillup_pw_field
      from  741e5dc dsdb: Add more tests for DN+String and DN+Binary comparisons

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0ce46318715577bd8273ed9c0880be54542f227f
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jan 30 14:24:06 2014 +0000

    winbind3: Simplify fillup_pw_field
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Wed Feb  5 13:47:52 CET 2014 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/winbindd/wb_fill_pwent.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/wb_fill_pwent.c b/source3/winbindd/wb_fill_pwent.c
index 359946f..c1f83e5 100644
--- a/source3/winbindd/wb_fill_pwent.c
+++ b/source3/winbindd/wb_fill_pwent.c
@@ -214,32 +214,31 @@ static bool fillup_pw_field(const char *lp_template,
 			    const char *in,
 			    fstring out)
 {
-	char *templ;
+	const char *templ;
+	char *result;
 
 	if (out == NULL)
 		return False;
 
-	/* 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 = lp_template;
 
 	if ((in != NULL) && (in[0] != '\0') && (lp_security() == SEC_ADS)) {
-		templ = talloc_sub_specified(talloc_tos(), in,
-					     username, grpname, domname,
-					     uid, gid);
-	} else {
-		templ = talloc_sub_specified(talloc_tos(), lp_template,
-					     username, grpname, domname,
-					     uid, gid);
+		/*
+		 * The backend has already filled in the required value. Use
+		 * that instead of the template.
+		 */
+		templ = in;
 	}
 
-	if (!templ)
+	result = talloc_sub_specified(talloc_tos(), templ,
+				      username, grpname, domname,
+				      uid, gid);
+	if (result == NULL) {
 		return False;
+	}
 
 	fstrcpy(out, templ);
-	TALLOC_FREE(templ);
+	TALLOC_FREE(result);
 
 	return True;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list