[SCM] Samba Shared Repository - branch v3-6-test updated

Karolin Seeger kseeger at samba.org
Fri Apr 12 01:53:38 MDT 2013


The branch, v3-6-test has been updated
       via  d9b8bd0 BUG 9139: Fix the username map optimization.
      from  6848fb1 BUG 9699: Fix adding case sensitive spn.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit d9b8bd03d002e0329a4b0ed4b1cc81d64fe9c6eb
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Apr 5 14:07:37 2013 +0200

    BUG 9139: Fix the username map optimization.
    
    If we successfully map a user. We call
    
    set_last_from_to(user_in, unixname);
    
    in the while loop reading the map file. After a successfull map we don't
    stop and continue the loop to check all other mappings in the username
    mapfile. But when we hit the end of the file and leave the loop we call:
    
    set_last_from_to(user_in, user_in);
    
    This overwrites the successful mapping, and the next time we call
    map_username() we skip the username and no mapping is done.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>

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

Summary of changes:
 source3/auth/user_util.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c
index d982c74..0ef0eb5 100644
--- a/source3/auth/user_util.c
+++ b/source3/auth/user_util.c
@@ -425,12 +425,16 @@ bool map_username(TALLOC_CTX *ctx, const char *user_in, char **p_user_out)
 	x_fclose(f);
 
 	/*
-	 * Setup the last_from and last_to as an optimization so
+	 * If we didn't successfully map a user in the loop above,
+	 * setup the last_from and last_to as an optimization so
 	 * that we don't scan the file again for the same user.
 	 */
-
-	set_last_from_to(user_in, user_in);
-	store_map_in_gencache(ctx, user_in, user_in);
+	if (!mapped_user) {
+		DEBUG(8, ("The user '%s' has no mapping. "
+			  "Skip it next time.\n", user_in));
+		set_last_from_to(user_in, user_in);
+		store_map_in_gencache(ctx, user_in, user_in);
+	}
 
 	return mapped_user;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list