1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00

Fixed (hopefully) last bug with username mapping.

map_username wasn't returning true on a map which
was causing find_service not to find a home directory.
Jeremy.
This commit is contained in:
Jeremy Allison 0001-01-01 00:00:00 +00:00
parent 2d0c9baa17
commit 97209a2946

View File

@ -58,6 +58,7 @@ BOOL map_username(char *user)
char *mapfile = lp_username_map(); char *mapfile = lp_username_map();
char *s; char *s;
pstring buf; pstring buf;
BOOL mapped_user = False;
if (!*user) if (!*user)
return False; return False;
@ -119,6 +120,7 @@ BOOL map_username(char *user)
if (strchr(dosname,'*') || user_in_list(user,dosname)) { if (strchr(dosname,'*') || user_in_list(user,dosname)) {
DEBUG(3,("Mapped user %s to %s\n",user,unixname)); DEBUG(3,("Mapped user %s to %s\n",user,unixname));
mapped_user = True;
fstrcpy(last_from,user); fstrcpy(last_from,user);
sscanf(unixname,"%s",user); sscanf(unixname,"%s",user);
fstrcpy(last_to,user); fstrcpy(last_to,user);
@ -132,14 +134,13 @@ BOOL map_username(char *user)
fclose(f); fclose(f);
/* /*
* Username wasn't mapped. Setup the last_from and last_to * Setup the last_from and last_to as an optimization so
* as an optimization so that we don't scan the file again * that we don't scan the file again for the same user.
* for the same user.
*/ */
fstrcpy(last_from,user); fstrcpy(last_from,user);
fstrcpy(last_to,user); fstrcpy(last_to,user);
return False; return mapped_user;
} }
/**************************************************************************** /****************************************************************************