check server role before doing nt user to unix user mapping
authorLuke Leighton <lkcl@samba.org>
Tue, 1 Dec 1998 22:39:33 +0000 (22:39 +0000)
committerLuke Leighton <lkcl@samba.org>
Tue, 1 Dec 1998 22:39:33 +0000 (22:39 +0000)
(This used to be commit 9d4e810e7dd8d6d80b47204636f9a37774f95455)

source3/smbd/reply.c

index 169f69ee07285817b55cc822e492eff7ba3e9eb6..d7069767143d1ed3318d7e27be25a0221a68d31f 100644 (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);
+               }
        }
 
        /*