summaryrefslogtreecommitdiff
path: root/source3/auth/auth_util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-24 11:56:09 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-24 11:56:09 +0000
commit59e0836b7f4221fd002abab083f71f04dffe7648 (patch)
treeda660ef946a99ed5fc5a74af265d014b73f2e250 /source3/auth/auth_util.c
parent3f03ecf5627ec0eda7fdbb4314ba804574751ede (diff)
downloadsamba-59e0836b7f4221fd002abab083f71f04dffe7648.tar.gz
samba-59e0836b7f4221fd002abab083f71f04dffe7648.tar.bz2
samba-59e0836b7f4221fd002abab083f71f04dffe7648.zip
Merge auth changes from HEAD:
- better error codes than NT_STATUS_UNSUCCESSFUL for domain logon errors - make auth_winbind load the ntdomain module if winbind isn't there. - use new trusted domains cache to determine if the domain is valid. Andrew Bartlett (This used to be commit ec8d6524c6b0c70927a2b57aab71d9e3a7f8a150)
Diffstat (limited to 'source3/auth/auth_util.c')
-rw-r--r--source3/auth/auth_util.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index d0f1fc1e34..a3ca0b226f 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -219,35 +219,18 @@ NTSTATUS make_user_info_map(auth_usersupplied_info **user_info,
where it doens't supply a domain for logon script
'net use' commands.
- The way I do it here is by checking if the fully
- qualified username exists. This is rather reliant
- on winbind, but until we have a better method this
- will have to do
+ Finally, we do this by looking up a cache of trusted domains!
*/
domain = client_domain;
- if ((smb_name) && (*smb_name)) { /* Don't do this for guests */
- char *user = NULL;
- if (asprintf(&user, "%s%s%s",
- client_domain, lp_winbind_separator(),
- smb_name) < 0) {
- DEBUG(0, ("make_user_info_map: asprintf() failed!\n"));
- return NT_STATUS_NO_MEMORY;
- }
-
- 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));
- }
- SAFE_FREE(user);
+ if (is_trusted_domain(domain)) {
+ return make_user_info(user_info, smb_name, internal_username,
+ client_domain, domain, wksta_name,
+ lm_pwd, nt_pwd, plaintext, ntlmssp_flags,
+ encrypted);
}
+
} else {
domain = lp_workgroup();
}