BUG 9139: Fix the username map optimization.
commitde6f18eb3851d5f8414dafc2db33ece290ddddc8
authorAndreas Schneider <asn@samba.org>
Fri, 5 Apr 2013 12:07:37 +0000 (5 14:07 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 26 Apr 2013 07:25:03 +0000 (26 09:25 +0200)
tree3ca3039a90daacaaef9c4b731ab95e26e7476109
parentf777a58ed55b1a870d96208fc7c543e2a49dec28
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@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit d9b8bd03d002e0329a4b0ed4b1cc81d64fe9c6eb)
source3/auth/user_util.c