Changeset 745 for trunk/server/source3/auth/auth_winbind.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/auth/auth_winbind.c
r414 r745 6 6 Copyright (C) Tim Potter 2000 7 7 Copyright (C) Andrew Bartlett 2001 - 2002 8 8 9 9 This program is free software; you can redistribute it and/or modify 10 10 it under the terms of the GNU General Public License as published by 11 11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 14 14 This program is distributed in the hope that it will be useful, 15 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 GNU General Public License for more details. 18 18 19 19 You should have received a copy of the GNU General Public License 20 20 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 22 22 23 23 #include "includes.h" 24 #include "auth.h" 25 #include "nsswitch/libwbclient/wbclient.h" 24 26 25 27 #undef DBGC_CLASS … … 31 33 void *my_private_data, 32 34 TALLOC_CTX *mem_ctx, 33 const auth_usersupplied_info *user_info,34 auth_serversupplied_info **server_info)35 const struct auth_usersupplied_info *user_info, 36 struct auth_serversupplied_info **server_info) 35 37 { 36 38 NTSTATUS nt_status; … … 40 42 struct wbcAuthErrorInfo *err = NULL; 41 43 44 ZERO_STRUCT(params); 45 42 46 if (!user_info) { 43 47 return NT_STATUS_INVALID_PARAMETER; 44 48 } 45 49 50 DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name)); 51 46 52 if (!auth_context) { 47 53 DEBUG(3,("Password for user %s cannot be checked because we have no auth_info to get the challenge from.\n", 48 user_info-> internal_username));54 user_info->mapped.account_name)); 49 55 return NT_STATUS_INVALID_PARAMETER; 50 56 } 51 57 52 if (strequal(user_info-> domain, get_global_sam_name())) {58 if (strequal(user_info->mapped.domain_name, get_global_sam_name())) { 53 59 DEBUG(3,("check_winbind_security: Not using winbind, requested domain [%s] was for this SAM.\n", 54 user_info-> domain));60 user_info->mapped.domain_name)); 55 61 return NT_STATUS_NOT_IMPLEMENTED; 56 62 } … … 58 64 /* Send off request */ 59 65 60 params.account_name = user_info-> smb_name;61 params.domain_name = user_info-> domain;62 params.workstation_name = user_info->w ksta_name;66 params.account_name = user_info->client.account_name; 67 params.domain_name = user_info->mapped.domain_name; 68 params.workstation_name = user_info->workstation_name; 63 69 64 70 params.flags = 0; … … 71 77 sizeof(params.password.response.challenge)); 72 78 73 params.password.response.nt_length = user_info->nt_resp.length; 74 params.password.response.nt_data = user_info->nt_resp.data; 75 params.password.response.lm_length = user_info->lm_resp.length; 76 params.password.response.lm_data = user_info->lm_resp.data; 79 if (user_info->password.response.nt.length != 0) { 80 params.password.response.nt_length = 81 user_info->password.response.nt.length; 82 params.password.response.nt_data = 83 user_info->password.response.nt.data; 84 } 85 if (user_info->password.response.lanman.length != 0) { 86 params.password.response.lm_length = 87 user_info->password.response.lanman.length; 88 params.password.response.lm_data = 89 user_info->password.response.lanman.data; 90 } 77 91 78 92 /* we are contacting the privileged pipe */ … … 97 111 return auth_method->auth(auth_context, auth_method->private_data, 98 112 mem_ctx, user_info, server_info); 99 else 100 /* log an error since this should not happen */ 101 DEBUG(0,("check_winbind_security: ERROR! my_private_data == NULL!\n")); 113 return NT_STATUS_LOGON_FAILURE; 102 114 } 103 115 … … 113 125 114 126 nt_status = make_server_info_wbcAuthUserInfo(mem_ctx, 115 user_info-> smb_name,116 user_info-> domain,127 user_info->client.account_name, 128 user_info->mapped.domain_name, 117 129 info, server_info); 118 130 wbcFreeMemory(info); … … 129 141 static NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 130 142 { 131 if (!make_auth_methods(auth_context, auth_method)) { 143 struct auth_methods *result; 144 145 result = TALLOC_ZERO_P(auth_context, struct auth_methods); 146 if (result == NULL) { 132 147 return NT_STATUS_NO_MEMORY; 133 148 } 134 135 (*auth_method)->name = "winbind"; 136 (*auth_method)->auth = check_winbind_security; 149 result->name = "winbind"; 150 result->auth = check_winbind_security; 137 151 138 152 if (param && *param) { … … 143 157 return NT_STATUS_UNSUCCESSFUL; 144 158 } 145 (*auth_method)->private_data = (void *)priv;159 result->private_data = (void *)priv; 146 160 } 161 162 *auth_method = result; 147 163 return NT_STATUS_OK; 148 164 }
Note:
See TracChangeset
for help on using the changeset viewer.