--- /dev/null
+/*
+ Unix SMB/CIFS implementation.
+ Standardised Authentication types
+ Copyright (C) Andrew Bartlett 2001-2010
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "librpc/gen_ndr/krb5pac.h"
+
+#define USER_INFO_CASE_INSENSITIVE_USERNAME 0x01 /* username may be in any case */
+#define USER_INFO_CASE_INSENSITIVE_PASSWORD 0x02 /* password may be in any case */
+#define USER_INFO_DONT_CHECK_UNIX_ACCOUNT 0x04 /* don't check unix account status */
+#define USER_INFO_INTERACTIVE_LOGON 0x08 /* don't check unix account status */
+
+enum auth_password_state {
+ AUTH_PASSWORD_RESPONSE,
+ AUTH_PASSWORD_HASH,
+ AUTH_PASSWORD_PLAIN
+};
+
+struct auth_usersupplied_info
+{
+ const char *workstation_name;
+ const struct tsocket_address *remote_host;
+
+ uint32_t logon_parameters;
+
+ bool mapped_state;
+ bool was_mapped;
+ /* the values the client gives us */
+ struct {
+ const char *account_name;
+ const char *domain_name;
+ } client, mapped;
+
+ enum auth_password_state password_state;
+
+ struct {
+ struct {
+ DATA_BLOB lanman;
+ DATA_BLOB nt;
+ } response;
+ struct {
+ struct samr_Password *lanman;
+ struct samr_Password *nt;
+ } hash;
+
+ char *plaintext;
+ } password;
+ uint32_t flags;
+};
#define _SAMBA_AUTH_H
#include "librpc/gen_ndr/ndr_krb5pac.h"
+#include "../auth/common_auth.h"
extern const char *krbtgt_attrs[];
extern const char *server_attrs[];
/* version 0 - till samba4 is stable - metze */
#define AUTH_INTERFACE_VERSION 0
-#define USER_INFO_CASE_INSENSITIVE_USERNAME 0x01 /* username may be in any case */
-#define USER_INFO_CASE_INSENSITIVE_PASSWORD 0x02 /* password may be in any case */
-#define USER_INFO_DONT_CHECK_UNIX_ACCOUNT 0x04 /* don't check unix account status */
-#define USER_INFO_INTERACTIVE_LOGON 0x08 /* don't check unix account status */
-
#define AUTH_SESSION_INFO_DEFAULT_GROUPS 0x01 /* Add the user to the default world and network groups */
#define AUTH_SESSION_INFO_AUTHENTICATED 0x02 /* Add the user to the 'authenticated users' group */
#define AUTH_SESSION_INFO_ENTERPRISE_DC 0x04 /* Add the user to the 'enterprise DC' group */
-enum auth_password_state {
- AUTH_PASSWORD_RESPONSE,
- AUTH_PASSWORD_HASH,
- AUTH_PASSWORD_PLAIN
-};
-
-struct auth_usersupplied_info
-{
- const char *workstation_name;
- const struct tsocket_address *remote_host;
-
- uint32_t logon_parameters;
-
- bool mapped_state;
- /* the values the client gives us */
- struct {
- const char *account_name;
- const char *domain_name;
- } client, mapped;
-
- enum auth_password_state password_state;
-
- union {
- struct {
- DATA_BLOB lanman;
- DATA_BLOB nt;
- } response;
- struct {
- struct samr_Password *lanman;
- struct samr_Password *nt;
- } hash;
-
- char *plaintext;
- } password;
- uint32_t flags;
-};
-
struct auth_serversupplied_info
{
struct dom_sid *account_sid;
return nt_status;
}
- user_info = talloc(tmp_ctx, struct auth_usersupplied_info);
+ user_info = talloc_zero(tmp_ctx, struct auth_usersupplied_info);
if (!user_info) {
talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
domain = default_domain;
}
- *user_info_mapped = talloc(mem_ctx, struct auth_usersupplied_info);
+ *user_info_mapped = talloc_zero(mem_ctx, struct auth_usersupplied_info);
if (!*user_info_mapped) {
return NT_STATUS_NO_MEMORY;
}
{
uint8_t chal[8];
DATA_BLOB chall_blob;
- user_info_temp = talloc(mem_ctx, struct auth_usersupplied_info);
+ user_info_temp = talloc_zero(mem_ctx, struct auth_usersupplied_info);
if (!user_info_temp) {
return NT_STATUS_NO_MEMORY;
}
struct samr_Password lanman;
struct samr_Password nt;
- user_info_temp = talloc(mem_ctx, struct auth_usersupplied_info);
+ user_info_temp = talloc_zero(mem_ctx, struct auth_usersupplied_info);
if (!user_info_temp) {
return NT_STATUS_NO_MEMORY;
}
NTSTATUS nt_status;
struct auth_usersupplied_info *user_info;
- user_info = talloc(ntlmssp_state, struct auth_usersupplied_info);
+ user_info = talloc_zero(ntlmssp_state, struct auth_usersupplied_info);
if (!user_info) {
return NT_STATUS_NO_MEMORY;
}
struct netr_SamInfo3 *sam3;
struct netr_SamInfo6 *sam6;
- user_info = talloc(mem_ctx, struct auth_usersupplied_info);
+ user_info = talloc_zero(mem_ctx, struct auth_usersupplied_info);
NT_STATUS_HAVE_NO_MEMORY(user_info);
- user_info->flags = 0;
- user_info->mapped_state = false;
- user_info->remote_host = NULL;
-
switch (r->in.logon_level) {
case NetlogonInteractiveInformation:
case NetlogonServiceInformation:
if (!remote_machine) goto nomem;
}
- user_info = talloc(req, struct auth_usersupplied_info);
+ user_info = talloc_zero(req, struct auth_usersupplied_info);
if (!user_info) goto nomem;
user_info->mapped_state = false;
if (!remote_machine) goto nomem;
}
- user_info = talloc(req, struct auth_usersupplied_info);
+ user_info = talloc_zero(req, struct auth_usersupplied_info);
if (!user_info) goto nomem;
user_info->mapped_state = false;