diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-03-23 09:01:30 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-03-23 09:01:30 +0000 |
commit | bf281ae3e5d686efc49c57952b9ffde52d3d8abf (patch) | |
tree | 5ea21c6282a7cfae4b4e16b6215cf6b36e243c70 /source3 | |
parent | 1c92b99c80632bfdaeba60be2ba885ad84285460 (diff) | |
download | samba-bf281ae3e5d686efc49c57952b9ffde52d3d8abf.tar.gz samba-bf281ae3e5d686efc49c57952b9ffde52d3d8abf.tar.bz2 samba-bf281ae3e5d686efc49c57952b9ffde52d3d8abf.zip |
Extra parinoa and DEBUG()s for the make_user_info_map() code.
(This used to be commit aa5f125bc0efeee99254e03f36426420db676527)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_util.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 587273d9b6..a834227e1f 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -195,6 +195,9 @@ BOOL make_user_info_map(auth_usersupplied_info **user_info, fstring internal_username; fstrcpy(internal_username, smb_name); map_username(internal_username); + + DEBUG(5, ("make_user_info_map: Mapping user [%s]\\[%s] from workstation [%s]\n", + client_domain, smb_name, wksta_name)); if (lp_allow_trusted_domains() && *client_domain) { @@ -216,14 +219,25 @@ BOOL make_user_info_map(auth_usersupplied_info **user_info, domain = client_domain; if ((smb_name) && (*smb_name)) { /* Don't do this for guests */ - char *user; - asprintf(&user, "%s%s%s", + char *user = NULL; + if (asprintf(&user, "%s%s%s", client_domain, lp_winbind_separator(), - smb_name); + smb_name) < 0) { + DEBUG(0, ("make_user_info_map: asprintf() failed!\n")); + return False; + } + + DEBUG(5, ("make_user_info_map: testing for user %s\n", user)); + if (Get_Pwnam(user) == NULL) { + DEBUG(5, ("make_user_info_map: test for user %s failed\n", user)); domain = lp_workgroup(); + DEBUG(5, ("make_user_info_map: trusted domain %s doesn't appear to exist, using %s\n", + client_domain, domain)); + } else { + DEBUG(5, ("make_user_info_map: using trusted domain %s\n", domain)); } - free(user); + SAFE_FREE(user); } } else { domain = lp_workgroup(); |