Changeset 745 for trunk/server/source3/auth/auth_builtin.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_builtin.c
r414 r745 4 4 Copyright (C) Andrew Bartlett 2001-2002 5 5 Copyright (C) Jelmer Vernooij 2002 6 6 7 7 This program is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 3 of the License, or 10 10 (at your option) any later version. 11 11 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 16 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 20 20 21 21 #include "includes.h" 22 #include "auth.h" 22 23 23 24 #undef DBGC_CLASS … … 35 36 void *my_private_data, 36 37 TALLOC_CTX *mem_ctx, 37 const auth_usersupplied_info *user_info,38 auth_serversupplied_info **server_info)38 const struct auth_usersupplied_info *user_info, 39 struct auth_serversupplied_info **server_info) 39 40 { 40 41 /* mark this as 'not for me' */ 41 42 NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED; 42 43 43 if (!(user_info->internal_username 44 && *user_info->internal_username)) { 44 DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name)); 45 46 if (!(user_info->mapped.account_name 47 && *user_info->mapped.account_name)) { 45 48 nt_status = make_server_info_guest(NULL, server_info); 46 49 } … … 53 56 static NTSTATUS auth_init_guest(struct auth_context *auth_context, const char *options, auth_methods **auth_method) 54 57 { 55 if (!make_auth_methods(auth_context, auth_method)) 58 struct auth_methods *result; 59 60 result = TALLOC_ZERO_P(auth_context, struct auth_methods); 61 if (result == NULL) { 56 62 return NT_STATUS_NO_MEMORY; 63 } 64 result->auth = check_guest_security; 65 result->name = "guest"; 57 66 58 (*auth_method)->auth = check_guest_security; 59 (*auth_method)->name = "guest"; 67 *auth_method = result; 60 68 return NT_STATUS_OK; 61 69 } … … 78 86 void *my_private_data, 79 87 TALLOC_CTX *mem_ctx, 80 const auth_usersupplied_info *user_info,81 auth_serversupplied_info **server_info)88 const struct auth_usersupplied_info *user_info, 89 struct auth_serversupplied_info **server_info) 82 90 { 83 91 NTSTATUS nt_status; 84 92 fstring user; 85 93 long error_num; 86 fstrcpy(user, user_info->smb_name); 87 94 95 DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name)); 96 97 fstrcpy(user, user_info->client.account_name); 98 88 99 if (strnequal("NT_STATUS", user, strlen("NT_STATUS"))) { 89 100 strupper_m(user); … … 93 104 strlower_m(user); 94 105 error_num = strtoul(user, NULL, 16); 95 106 96 107 DEBUG(5,("check_name_to_ntstatus_security: Error for user %s was %lx\n", user, error_num)); 97 108 98 109 nt_status = NT_STATUS(error_num); 99 110 100 111 return nt_status; 101 112 } … … 105 116 static NTSTATUS auth_init_name_to_ntstatus(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 106 117 { 107 if (!make_auth_methods(auth_context, auth_method)) 118 struct auth_methods *result; 119 120 result = TALLOC_ZERO_P(auth_context, struct auth_methods); 121 if (result == NULL) { 108 122 return NT_STATUS_NO_MEMORY; 123 } 124 result->auth = check_name_to_ntstatus_security; 125 result->name = "name_to_ntstatus"; 109 126 110 (*auth_method)->auth = check_name_to_ntstatus_security; 111 (*auth_method)->name = "name_to_ntstatus"; 127 *auth_method = result; 112 128 return NT_STATUS_OK; 113 129 } … … 131 147 void *my_private_data, 132 148 TALLOC_CTX *mem_ctx, 133 const auth_usersupplied_info *user_info,134 auth_serversupplied_info **server_info)149 const struct auth_usersupplied_info *user_info, 150 struct auth_serversupplied_info **server_info) 135 151 { 136 152 return NT_STATUS_NOT_IMPLEMENTED; … … 150 166 151 167 152 /** Module init ailisation function */168 /** Module initialisation function */ 153 169 154 170 static NTSTATUS auth_init_fixed_challenge(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 155 171 { 156 if (!make_auth_methods(auth_context, auth_method)) 172 struct auth_methods *result; 173 174 result = TALLOC_ZERO_P(auth_context, struct auth_methods); 175 if (result == NULL) { 157 176 return NT_STATUS_NO_MEMORY; 177 } 178 result->auth = check_fixed_challenge_security; 179 result->get_chal = auth_get_fixed_challenge; 180 result->name = "fixed_challenge"; 158 181 159 (*auth_method)->auth = check_fixed_challenge_security; 160 (*auth_method)->get_chal = auth_get_fixed_challenge; 161 (*auth_method)->name = "fixed_challenge"; 182 *auth_method = result; 162 183 return NT_STATUS_OK; 163 184 }
Note:
See TracChangeset
for help on using the changeset viewer.