1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-29 11:21:54 +03:00

check server role before doing nt user to unix user mapping

(This used to be commit 9d4e810e7d)
This commit is contained in:
Luke Leighton 1998-12-01 22:39:33 +00:00
parent 5dd26daad5
commit 08cdea519c

View File

@ -73,20 +73,23 @@ static void map_nt_and_unix_username(const char *domain, char *user)
* function.
*/
memset(nt_username, 0, sizeof(nt_username));
if (domain != NULL)
if (lp_server_role() != ROLE_DOMAIN_NONE)
{
slprintf(nt_username, sizeof(nt_username)-1, "%s\\%s",
domain, user);
}
else
{
fstrcpy(nt_username, user);
}
memset(nt_username, 0, sizeof(nt_username));
if (domain != NULL)
{
slprintf(nt_username, sizeof(nt_username)-1, "%s\\%s",
domain, user);
}
else
{
fstrcpy(nt_username, user);
}
if (lookupsmbpwntnam(nt_username, &gmep))
{
fstrcpy(user, gmep.unix_name);
if (lookupsmbpwntnam(nt_username, &gmep))
{
fstrcpy(user, gmep.unix_name);
}
}
/*