The Samba-Bugzilla – Attachment 8745 Details for
Bug 9139
[Patch]: username mapping may fail in map_username()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v4-0-test patch
0001-BUG-9139-Fix-the-username-map-optimization.patch (text/plain), 1.76 KB, created by
Andreas Schneider
on 2013-04-10 07:55:37 UTC
(
hide
)
Description:
v4-0-test patch
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2013-04-10 07:55:37 UTC
Size:
1.76 KB
patch
obsolete
>From 691676440eaf900e8936694c98aa4cb555cf98d1 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Fri, 5 Apr 2013 14:07:37 +0200 >Subject: [PATCH 1/2] BUG 9139: Fix the username map optimization. >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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@samba.org> >Reviewed-by: Günther Deschner <gd@samba.org> >--- > source3/auth/user_util.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c >index 4842192..082c885 100644 >--- a/source3/auth/user_util.c >+++ b/source3/auth/user_util.c >@@ -427,12 +427,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; > } >-- >1.8.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
gd
:
review+
vl
:
review+
Actions:
View
Attachments on
bug 9139
: 8745 |
8746