summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-05-26 16:38:45 +0200
committerStefan Metzmacher <metze@samba.org>2009-06-03 17:54:37 +0200
commit75d03970b78538346308c612ca6be15559e15b5b (patch)
tree889269e996fffd10cfd3b9f0c359b97c48117f4b /source3/auth
parent356f0336e558465318450da8936ebfef3f1f4eb1 (diff)
downloadsamba-75d03970b78538346308c612ca6be15559e15b5b.tar.gz
samba-75d03970b78538346308c612ca6be15559e15b5b.tar.bz2
samba-75d03970b78538346308c612ca6be15559e15b5b.zip
s3:smbd: move more session specific globals to struct smbd_server_connection
metze
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_compat.c7
-rw-r--r--source3/auth/auth_util.c7
2 files changed, 9 insertions, 5 deletions
diff --git a/source3/auth/auth_compat.c b/source3/auth/auth_compat.c
index d8087e6588..77a994828f 100644
--- a/source3/auth/auth_compat.c
+++ b/source3/auth/auth_compat.c
@@ -97,6 +97,7 @@ return True if the password is correct, False otherwise
****************************************************************************/
bool password_ok(struct auth_context *actx, bool global_encrypted,
+ const char *session_workgroup,
const char *smb_name, DATA_BLOB password_blob)
{
@@ -109,11 +110,11 @@ bool password_ok(struct auth_context *actx, bool global_encrypted,
* but fall-through as required.
* Vista sends NTLMv2 here - we need to try the client given workgroup.
*/
- if (get_session_workgroup()) {
- if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, get_session_workgroup(), null_password, password_blob, null_password, encrypted))) {
+ if (session_workgroup) {
+ if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, null_password, password_blob, null_password, encrypted))) {
return True;
}
- if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, get_session_workgroup(), password_blob, null_password, null_password, encrypted))) {
+ if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, password_blob, null_password, null_password, encrypted))) {
return True;
}
}
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 9d29987c0d..d53da7867c 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -22,6 +22,7 @@
*/
#include "includes.h"
+#include "smbd/globals.h"
#include "../libcli/auth/libcli_auth.h"
#undef DBGC_CLASS
@@ -198,12 +199,13 @@ NTSTATUS make_user_info_map(auth_usersupplied_info **user_info,
DATA_BLOB *plaintext,
bool encrypted)
{
+ struct smbd_server_connection *sconn = smbd_server_conn;
const char *domain;
NTSTATUS result;
bool was_mapped;
fstring internal_username;
fstrcpy(internal_username, smb_name);
- was_mapped = map_username(internal_username);
+ was_mapped = map_username(sconn, internal_username);
DEBUG(5, ("Mapping user [%s]\\[%s] from workstation [%s]\n",
client_domain, smb_name, wksta_name));
@@ -1487,6 +1489,7 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx,
struct samu *account,
bool *username_was_mapped)
{
+ struct smbd_server_connection *sconn = smbd_server_conn;
NTSTATUS nt_status;
fstring dom_user, lower_username;
fstring real_username;
@@ -1500,7 +1503,7 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx,
/* Get the passwd struct. Try to create the account is necessary. */
- *username_was_mapped = map_username( dom_user );
+ *username_was_mapped = map_username(sconn, dom_user);
if ( !(passwd = smb_getpwnam( NULL, dom_user, real_username, True )) )
return NT_STATUS_NO_SUCH_USER;