Don't do tridge's crazy 'am I a trusted domain' lookup for guests.
authorAndrew Bartlett <abartlet@samba.org>
Fri, 18 Jan 2002 08:12:10 +0000 (08:12 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 18 Jan 2002 08:12:10 +0000 (08:12 +0000)
Andrew Bartlett
(This used to be commit 9bfe54a3d484919fe830f9c6ae01f67663974af2)

source3/auth/auth_util.c

index 643c2e19963fe0ab34b74efb64b85a977ce3b6ee..0839b1966589ecc5161ad413f3c5c61ed823310f 100644 (file)
@@ -198,7 +198,6 @@ BOOL make_user_info_map(auth_usersupplied_info **user_info,
        map_username(internal_username); 
        
        if (lp_allow_trusted_domains()) {
-               char *user;
                /* the client could have given us a workstation name
                   or other crap for the workgroup - we really need a
                   way of telling if this domain name is one of our
@@ -209,15 +208,19 @@ BOOL make_user_info_map(auth_usersupplied_info **user_info,
                   on winbind, but until we have a better method this
                   will have to do 
                */
-               asprintf(&user, "%s%s%s", 
-                        client_domain, lp_winbind_separator(), 
-                        smb_name);
-               if (Get_Pwnam(user) != NULL) {
-                       domain = client_domain;
-               } else {
-                       domain = lp_workgroup();
+
+               domain = client_domain;
+
+               if ((smb_name) && (*smb_name)) { /* Don't do this for guests */
+                       char *user;
+                       asprintf(&user, "%s%s%s", 
+                                client_domain, lp_winbind_separator(), 
+                                smb_name);
+                       if (Get_Pwnam(user) == NULL) {
+                               domain = lp_workgroup();
+                       }
+                       free(user);
                }
-               free(user);
        } else {
                domain = lp_workgroup();
        }