s4/auth: Add logon_parameters to authenticate_username_pw
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Thu, 4 Nov 2010 22:00:13 +0000 (00:00 +0200)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Fri, 5 Nov 2010 06:32:43 +0000 (06:32 +0000)
We need to be able to set the logon parameters in the same way as in the
ntlm server so we can handle openldap simple authentication call correctly.

Autobuild-User: Anatoliy Atanasov <anatoliy@samba.org>
Autobuild-Date: Fri Nov  5 06:32:43 UTC 2010 on sn-devel-104

source4/auth/auth.h
source4/auth/ntlm/auth_simple.c
source4/ldap_server/ldap_bind.c

index 2f0af027bc655a94beec264a2295442973341adb..0f6386fb7ac6c98c4f79589485b140e57589bf8f 100644 (file)
@@ -248,13 +248,14 @@ NTSTATUS auth_init(void);
 NTSTATUS auth_register(const struct auth_operations *ops);
 NTSTATUS server_service_auth_init(void);
 NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
-                                          struct tevent_context *ev,
-                                          struct messaging_context *msg,
-                                          struct loadparm_context *lp_ctx,
-                                          const char *nt4_domain,
-                                          const char *nt4_username,
-                                          const char *password,
-                                          struct auth_session_info **session_info);
+                                 struct tevent_context *ev,
+                                 struct messaging_context *msg,
+                                 struct loadparm_context *lp_ctx,
+                                 const char *nt4_domain,
+                                 const char *nt4_username,
+                                 const char *password,
+                                 const uint32_t logon_parameters,
+                                 struct auth_session_info **session_info);
 
 struct tevent_req *auth_check_password_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
index 65a08cd92b7ff3348af7dc2b81102949fc81f771..1079fba527bd5607afeec446436c5fa5ab0da2c8 100644 (file)
@@ -35,6 +35,7 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
                                           const char *nt4_domain,
                                           const char *nt4_username,
                                           const char *password,
+                                          const uint32_t logon_parameters,
                                           struct auth_session_info **session_info) 
 {
        struct auth_context *auth_context;
@@ -78,7 +79,9 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
        user_info->flags = USER_INFO_CASE_INSENSITIVE_USERNAME |
                USER_INFO_DONT_CHECK_UNIX_ACCOUNT;
 
-       user_info->logon_parameters = 0;
+       user_info->logon_parameters = logon_parameters |
+               MSV1_0_CLEARTEXT_PASSWORD_ALLOWED |
+               MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED;
 
        nt_status = auth_check_password(auth_context, tmp_ctx, user_info, &server_info);
        if (!NT_STATUS_IS_OK(nt_status)) {
index 5036353a4b34a92cf36ba92126e21e85779dba2e..25be4802d6b19ce80e29b51cdd4598005f5bc002 100644 (file)
@@ -53,6 +53,8 @@ static NTSTATUS ldapsrv_BindSimple(struct ldapsrv_call *call)
                                                  call->conn->lp_ctx,
                                                  nt4_domain, nt4_account, 
                                                  req->creds.password,
+                                                 MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT |
+                                                 MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT,
                                                  &session_info);
        }