From 33c633df0bb49551a833d1bf86db0825b8007546 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 29 May 2010 16:49:37 -0400 Subject: [PATCH] s3:auth make it easier to trace auth modules --- source3/auth/auth_builtin.c | 5 +++++ source3/auth/auth_domain.c | 4 ++++ source3/auth/auth_netlogond.c | 2 ++ source3/auth/auth_sam.c | 2 ++ source3/auth/auth_server.c | 2 ++ source3/auth/auth_unix.c | 2 ++ source3/auth/auth_wbc.c | 2 ++ source3/auth/auth_winbind.c | 2 ++ 8 files changed, 21 insertions(+) diff --git a/source3/auth/auth_builtin.c b/source3/auth/auth_builtin.c index e2ad84834da6..9e8fec9b4a08 100644 --- a/source3/auth/auth_builtin.c +++ b/source3/auth/auth_builtin.c @@ -40,6 +40,8 @@ static NTSTATUS check_guest_security(const struct auth_context *auth_context, /* mark this as 'not for me' */ NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + if (!(user_info->internal_username && *user_info->internal_username)) { nt_status = make_server_info_guest(NULL, server_info); @@ -88,6 +90,9 @@ static NTSTATUS check_name_to_ntstatus_security(const struct auth_context *auth_ NTSTATUS nt_status; fstring user; long error_num; + + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + fstrcpy(user, user_info->smb_name); if (strnequal("NT_STATUS", user, strlen("NT_STATUS"))) { diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index ef58250ce0f5..a42f3a1169bd 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -393,6 +393,8 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, return NT_STATUS_INVALID_PARAMETER; } + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + /* * Check that the requested domain is not our own machine name. * If it is, we should never check the PDC here, we use our own local @@ -461,6 +463,8 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte return NT_STATUS_INVALID_PARAMETER; } + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + /* * Check that the requested domain is not our own machine name or domain name. */ diff --git a/source3/auth/auth_netlogond.c b/source3/auth/auth_netlogond.c index e5f2a1bd4eb7..1442e2f6ee4e 100644 --- a/source3/auth/auth_netlogond.c +++ b/source3/auth/auth_netlogond.c @@ -170,6 +170,8 @@ static NTSTATUS check_netlogond_security(const struct auth_context *auth_context struct named_mutex *mutex = NULL; const char *ncalrpcsock; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + ncalrpcsock = lp_parm_const_string( GLOBAL_SECTION_SNUM, "auth_netlogond", "socket", NULL); diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 4220b7afd589..324295f92489 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -72,6 +72,8 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context, return NT_STATUS_LOGON_FAILURE; } + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + is_local_name = is_myname(user_info->domain); is_my_domain = strequal(user_info->domain, lp_workgroup()); diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 4bcb7967c04f..35b7fe652cf1 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -281,6 +281,8 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED; bool locally_made_cli = False; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + cli = state->cli; if (cli) { diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c index 86c5a586d950..2bc2b06f1558 100644 --- a/source3/auth/auth_unix.c +++ b/source3/auth/auth_unix.c @@ -91,6 +91,8 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context, NTSTATUS nt_status; struct passwd *pass = NULL; + DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username)); + become_root(); pass = Get_Pwnam_alloc(talloc_tos(), user_info->internal_username); diff --git a/source3/auth/auth_wbc.c b/source3/auth/auth_wbc.c index b91a57357dbc..11cc7eafb357 100644 --- a/source3/auth/auth_wbc.c +++ b/source3/auth/auth_wbc.c @@ -61,6 +61,8 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context, } /* Send off request */ + DEBUG(10, ("Check auth for: [%s]", user_info->internal_username)); + params.account_name = user_info->smb_name; params.domain_name = user_info->domain; params.workstation_name = user_info->wksta_name; diff --git a/source3/auth/auth_winbind.c b/source3/auth/auth_winbind.c index 86a6194bcfb9..68509e434266 100644 --- a/source3/auth/auth_winbind.c +++ b/source3/auth/auth_winbind.c @@ -43,6 +43,8 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context, return NT_STATUS_INVALID_PARAMETER; } + DEBUG(10, ("Check auth for: [%s]", user_info->internal_username)); + if (!auth_context) { DEBUG(3,("Password for user %s cannot be checked because we have no auth_info to get the challenge from.\n", user_info->internal_username)); -- 2.34.1