Changeset 745 for trunk/server/source3/auth/auth_script.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_script.c
r414 r745 5 5 6 6 Copyright (C) Jeremy Allison 2005. 7 7 8 8 This program is free software; you can redistribute it and/or modify 9 9 it under the terms of the GNU General Public License as published by 10 10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 13 13 This program is distributed in the hope that it will be useful, 14 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 GNU General Public License for more details. 17 17 18 18 You should have received a copy of the GNU General Public License 19 19 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 21 21 22 22 #include "includes.h" 23 #include "auth.h" 23 24 24 25 #undef malloc … … 41 42 void *my_private_data, 42 43 TALLOC_CTX *mem_ctx, 43 const auth_usersupplied_info *user_info,44 auth_serversupplied_info **server_info)44 const struct auth_usersupplied_info *user_info, 45 struct auth_serversupplied_info **server_info) 45 46 { 46 47 const char *script = lp_parm_const_string( GLOBAL_SECTION_SNUM, "auth_script", "script", NULL); … … 63 64 } 64 65 65 secret_str_len = strlen(user_info-> domain) + 1 +66 strlen(user_info-> smb_name) + 1 +66 secret_str_len = strlen(user_info->mapped.domain_name) + 1 + 67 strlen(user_info->client.account_name) + 1 + 67 68 16 + 1 + /* 8 bytes of challenge going to 16 */ 68 69 48 + 1 + /* 24 bytes of challenge going to 48 */ … … 74 75 } 75 76 76 safe_strcpy( secret_str, user_info-> domain, secret_str_len - 1);77 safe_strcpy( secret_str, user_info->mapped.domain_name, secret_str_len - 1); 77 78 safe_strcat( secret_str, "\n", secret_str_len - 1); 78 safe_strcat( secret_str, user_info-> smb_name, secret_str_len - 1);79 safe_strcat( secret_str, user_info->client.account_name, secret_str_len - 1); 79 80 safe_strcat( secret_str, "\n", secret_str_len - 1); 80 81 … … 85 86 safe_strcat( secret_str, "\n", secret_str_len - 1); 86 87 87 if (user_info-> lm_resp.data) {88 if (user_info->password.response.lanman.data) { 88 89 for (i = 0; i < 24; i++) { 89 slprintf(&hex_str[i*2], 3, "%02X", user_info-> lm_resp.data[i]);90 slprintf(&hex_str[i*2], 3, "%02X", user_info->password.response.lanman.data[i]); 90 91 } 91 92 safe_strcat( secret_str, hex_str, secret_str_len - 1); … … 93 94 safe_strcat( secret_str, "\n", secret_str_len - 1); 94 95 95 if (user_info-> nt_resp.data) {96 if (user_info->password.response.nt.data) { 96 97 for (i = 0; i < 24; i++) { 97 slprintf(&hex_str[i*2], 3, "%02X", user_info-> nt_resp.data[i]);98 slprintf(&hex_str[i*2], 3, "%02X", user_info->password.response.nt.data[i]); 98 99 } 99 100 safe_strcat( secret_str, hex_str, secret_str_len - 1); … … 110 111 if (ret) { 111 112 DEBUG(1,("script_check_user_credentials: failed to authenticate %s\\%s\n", 112 user_info-> domain, user_info->smb_name ));113 user_info->mapped.domain_name, user_info->client.account_name )); 113 114 /* auth failed. */ 114 115 return NT_STATUS_NO_SUCH_USER; … … 122 123 static NTSTATUS auth_init_script(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 123 124 { 124 if (!make_auth_methods(auth_context, auth_method)) { 125 struct auth_methods *result; 126 127 result = TALLOC_ZERO_P(auth_context, struct auth_methods); 128 if (result == NULL) { 125 129 return NT_STATUS_NO_MEMORY; 126 130 } 127 128 (*auth_method)->name = "script"; 129 (*auth_method)->auth = script_check_user_credentials; 131 result->name = "script"; 132 result->auth = script_check_user_credentials; 130 133 131 134 if (param && *param) { … … 136 139 return NT_STATUS_UNSUCCESSFUL; 137 140 } 138 (*auth_method)->private_data = (void *)priv;141 result->private_data = (void *)priv; 139 142 } 143 144 *auth_method = result; 140 145 return NT_STATUS_OK; 141 146 }
Note:
See TracChangeset
for help on using the changeset viewer.