summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/auth_util.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 643c2e1996..0839b19665 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -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();
}