Line data Source code
1 : /*
2 : Unix SMB/CIFS implementation.
3 : Authentication utility functions
4 : Copyright (C) Andrew Tridgell 1992-1998
5 : Copyright (C) Andrew Bartlett 2001-2010
6 : Copyright (C) Jeremy Allison 2000-2001
7 : Copyright (C) Rafal Szczesniak 2002
8 : Copyright (C) Stefan Metzmacher 2005
9 :
10 : This program is free software; you can redistribute it and/or modify
11 : it under the terms of the GNU General Public License as published by
12 : the Free Software Foundation; either version 3 of the License, or
13 : (at your option) any later version.
14 :
15 : This program is distributed in the hope that it will be useful,
16 : but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : GNU General Public License for more details.
19 :
20 : You should have received a copy of the GNU General Public License
21 : along with this program. If not, see <http://www.gnu.org/licenses/>.
22 : */
23 :
24 : #include "includes.h"
25 : #include "libcli/security/security.h"
26 : #include "auth/credentials/credentials.h"
27 : #include "param/param.h"
28 : #include "auth/auth.h" /* for auth_user_info_dc */
29 : #include "auth/session.h"
30 : #include "auth/system_session_proto.h"
31 :
32 : #undef DBGC_CLASS
33 : #define DBGC_CLASS DBGC_AUTH
34 :
35 : /*
36 : prevent the static system session being freed
37 : */
38 0 : static int system_session_destructor(struct auth_session_info *info)
39 : {
40 0 : return -1;
41 : }
42 :
43 : /* Create a security token for a session SYSTEM (the most
44 : * trusted/privileged account), including the local machine account as
45 : * the off-host credentials
46 : */
47 227149 : _PUBLIC_ struct auth_session_info *system_session(struct loadparm_context *lp_ctx)
48 : {
49 8644 : static struct auth_session_info *static_session;
50 8644 : NTSTATUS nt_status;
51 :
52 227149 : if (static_session) {
53 213382 : return static_session;
54 : }
55 :
56 : /*
57 : * Use NULL here, not the autofree context for this
58 : * static pointer. The destructor prevents freeing this
59 : * memory anyway.
60 : */
61 5504 : nt_status = auth_system_session_info(NULL,
62 : lp_ctx,
63 : &static_session);
64 5504 : if (!NT_STATUS_IS_OK(nt_status)) {
65 60 : TALLOC_FREE(static_session);
66 60 : return NULL;
67 : }
68 5444 : talloc_set_destructor(static_session, system_session_destructor);
69 5444 : return static_session;
70 : }
71 :
72 5504 : NTSTATUS auth_system_session_info(TALLOC_CTX *parent_ctx,
73 : struct loadparm_context *lp_ctx,
74 : struct auth_session_info **_session_info)
75 : {
76 381 : NTSTATUS nt_status;
77 5504 : struct auth_user_info_dc *user_info_dc = NULL;
78 5504 : struct auth_session_info *session_info = NULL;
79 5504 : TALLOC_CTX *mem_ctx = NULL;
80 381 : bool ok;
81 :
82 5504 : mem_ctx = talloc_new(parent_ctx);
83 5504 : if (mem_ctx == NULL) {
84 0 : return NT_STATUS_NO_MEMORY;
85 : }
86 :
87 5504 : nt_status = auth_system_user_info_dc(mem_ctx, lpcfg_netbios_name(lp_ctx),
88 : &user_info_dc);
89 5504 : if (!NT_STATUS_IS_OK(nt_status)) {
90 60 : talloc_free(mem_ctx);
91 60 : return nt_status;
92 : }
93 :
94 : /* references the user_info_dc into the session_info */
95 5444 : nt_status = auth_generate_session_info(parent_ctx,
96 : lp_ctx,
97 : NULL /* sam_ctx */,
98 : user_info_dc,
99 : AUTH_SESSION_INFO_SIMPLE_PRIVILEGES,
100 : &session_info);
101 5444 : talloc_free(mem_ctx);
102 :
103 5444 : NT_STATUS_NOT_OK_RETURN(nt_status);
104 :
105 5444 : session_info->credentials = cli_credentials_init(session_info);
106 5444 : if (!session_info->credentials) {
107 0 : talloc_free(session_info);
108 0 : return NT_STATUS_NO_MEMORY;
109 : }
110 :
111 5444 : ok = cli_credentials_set_conf(session_info->credentials, lp_ctx);
112 5444 : if (!ok) {
113 0 : talloc_free(session_info);
114 0 : return NT_STATUS_INTERNAL_ERROR;
115 : }
116 :
117 5444 : cli_credentials_set_machine_account_pending(session_info->credentials, lp_ctx);
118 5444 : *_session_info = session_info;
119 :
120 5444 : return NT_STATUS_OK;
121 : }
122 :
123 6684 : NTSTATUS auth_system_user_info_dc(TALLOC_CTX *mem_ctx, const char *netbios_name,
124 : struct auth_user_info_dc **_user_info_dc)
125 : {
126 389 : struct auth_user_info_dc *user_info_dc;
127 389 : struct auth_user_info *info;
128 :
129 6684 : user_info_dc = talloc_zero(mem_ctx, struct auth_user_info_dc);
130 6684 : NT_STATUS_HAVE_NO_MEMORY(user_info_dc);
131 :
132 : /* This returns a pointer to a struct dom_sid, which is the
133 : * same as a 1 element list of struct dom_sid */
134 6684 : user_info_dc->num_sids = 1;
135 6684 : user_info_dc->sids = talloc(user_info_dc, struct auth_SidAttr);
136 6684 : if (user_info_dc->sids == NULL) {
137 0 : talloc_free(user_info_dc);
138 0 : return NT_STATUS_NO_MEMORY;
139 : }
140 :
141 6684 : user_info_dc->sids->sid = global_sid_System;
142 6684 : user_info_dc->sids->attrs = SE_GROUP_DEFAULT_FLAGS;
143 :
144 : /* annoying, but the Anonymous really does have a session key,
145 : and it is all zeros! */
146 6684 : user_info_dc->user_session_key = data_blob_talloc(user_info_dc, NULL, 16);
147 6684 : if (user_info_dc->user_session_key.data == NULL) {
148 0 : talloc_free(user_info_dc);
149 0 : return NT_STATUS_NO_MEMORY;
150 : }
151 :
152 6684 : user_info_dc->lm_session_key = data_blob_talloc(user_info_dc, NULL, 16);
153 6684 : if (user_info_dc->lm_session_key.data == NULL) {
154 0 : talloc_free(user_info_dc);
155 0 : return NT_STATUS_NO_MEMORY;
156 : }
157 :
158 6684 : data_blob_clear(&user_info_dc->user_session_key);
159 6684 : data_blob_clear(&user_info_dc->lm_session_key);
160 :
161 6684 : user_info_dc->info = info = talloc_zero(user_info_dc, struct auth_user_info);
162 6684 : if (user_info_dc->info == NULL) {
163 0 : talloc_free(user_info_dc);
164 0 : return NT_STATUS_NO_MEMORY;
165 389 : };
166 :
167 6684 : info->account_name = talloc_strdup(info, "SYSTEM");
168 6684 : if (info->account_name == NULL) {
169 0 : talloc_free(user_info_dc);
170 0 : return NT_STATUS_NO_MEMORY;
171 389 : };
172 :
173 6684 : info->domain_name = talloc_strdup(info, "NT AUTHORITY");
174 6684 : if (info->domain_name == NULL) {
175 0 : talloc_free(user_info_dc);
176 0 : return NT_STATUS_NO_MEMORY;
177 389 : };
178 :
179 6684 : info->full_name = talloc_strdup(info, "System");
180 6684 : if (info->full_name == NULL) {
181 0 : talloc_free(user_info_dc);
182 0 : return NT_STATUS_NO_MEMORY;
183 389 : };
184 :
185 6684 : info->logon_script = talloc_strdup(info, "");
186 6684 : if (info->logon_script == NULL) {
187 0 : talloc_free(user_info_dc);
188 0 : return NT_STATUS_NO_MEMORY;
189 389 : };
190 :
191 6684 : info->profile_path = talloc_strdup(info, "");
192 6684 : if (info->profile_path == NULL) {
193 0 : talloc_free(user_info_dc);
194 0 : return NT_STATUS_NO_MEMORY;
195 389 : };
196 :
197 6684 : info->home_directory = talloc_strdup(info, "");
198 6684 : if (info->home_directory == NULL) {
199 0 : talloc_free(user_info_dc);
200 0 : return NT_STATUS_NO_MEMORY;
201 389 : };
202 :
203 6684 : info->home_drive = talloc_strdup(info, "");
204 6684 : if (info->home_drive == NULL) {
205 0 : talloc_free(user_info_dc);
206 0 : return NT_STATUS_NO_MEMORY;
207 389 : };
208 :
209 6684 : info->logon_server = talloc_strdup(info, netbios_name);
210 6684 : if (info->logon_server == NULL) {
211 60 : talloc_free(user_info_dc);
212 60 : return NT_STATUS_NO_MEMORY;
213 331 : };
214 :
215 6624 : info->last_logon = 0;
216 6624 : info->last_logoff = 0;
217 6624 : info->acct_expiry = 0;
218 6624 : info->last_password_change = 0;
219 6624 : info->allow_password_change = 0;
220 6624 : info->force_password_change = 0;
221 :
222 6624 : info->logon_count = 0;
223 6624 : info->bad_password_count = 0;
224 :
225 6624 : info->acct_flags = ACB_NORMAL;
226 :
227 6624 : info->user_flags = 0;
228 :
229 6624 : *_user_info_dc = user_info_dc;
230 :
231 6624 : return NT_STATUS_OK;
232 : }
233 :
234 :
235 1099 : static NTSTATUS auth_domain_admin_user_info_dc(TALLOC_CTX *mem_ctx,
236 : const char *netbios_name,
237 : const char *domain_name,
238 : struct dom_sid *domain_sid,
239 : struct auth_user_info_dc **_user_info_dc)
240 : {
241 80 : struct auth_user_info_dc *user_info_dc;
242 80 : struct auth_user_info *info;
243 :
244 1099 : user_info_dc = talloc_zero(mem_ctx, struct auth_user_info_dc);
245 1099 : NT_STATUS_HAVE_NO_MEMORY(user_info_dc);
246 :
247 1099 : user_info_dc->num_sids = 8;
248 1099 : user_info_dc->sids = talloc_array(user_info_dc, struct auth_SidAttr, user_info_dc->num_sids);
249 :
250 1099 : user_info_dc->sids[PRIMARY_USER_SID_INDEX].sid = *domain_sid;
251 1099 : sid_append_rid(&user_info_dc->sids[PRIMARY_USER_SID_INDEX].sid, DOMAIN_RID_ADMINISTRATOR);
252 1099 : user_info_dc->sids[PRIMARY_USER_SID_INDEX].attrs = SE_GROUP_DEFAULT_FLAGS;
253 :
254 1099 : user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].sid = *domain_sid;
255 1099 : sid_append_rid(&user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].sid, DOMAIN_RID_USERS);
256 1099 : user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].attrs = SE_GROUP_DEFAULT_FLAGS;
257 :
258 : /* Add the primary group again. */
259 1099 : user_info_dc->sids[2] = user_info_dc->sids[PRIMARY_GROUP_SID_INDEX];
260 :
261 1099 : user_info_dc->sids[3].sid = global_sid_Builtin_Administrators;
262 1099 : user_info_dc->sids[3].attrs = SE_GROUP_DEFAULT_FLAGS;
263 :
264 1099 : user_info_dc->sids[4].sid = *domain_sid;
265 1099 : sid_append_rid(&user_info_dc->sids[4].sid, DOMAIN_RID_ADMINS);
266 1099 : user_info_dc->sids[4].attrs = SE_GROUP_DEFAULT_FLAGS;
267 1099 : user_info_dc->sids[5].sid = *domain_sid;
268 1099 : sid_append_rid(&user_info_dc->sids[5].sid, DOMAIN_RID_ENTERPRISE_ADMINS);
269 1099 : user_info_dc->sids[5].attrs = SE_GROUP_DEFAULT_FLAGS;
270 1099 : user_info_dc->sids[6].sid = *domain_sid;
271 1099 : sid_append_rid(&user_info_dc->sids[6].sid, DOMAIN_RID_POLICY_ADMINS);
272 1099 : user_info_dc->sids[6].attrs = SE_GROUP_DEFAULT_FLAGS;
273 1099 : user_info_dc->sids[7].sid = *domain_sid;
274 1099 : sid_append_rid(&user_info_dc->sids[7].sid, DOMAIN_RID_SCHEMA_ADMINS);
275 1099 : user_info_dc->sids[7].attrs = SE_GROUP_DEFAULT_FLAGS;
276 :
277 : /* What should the session key be?*/
278 1099 : user_info_dc->user_session_key = data_blob_talloc(user_info_dc, NULL, 16);
279 1099 : if (user_info_dc->user_session_key.data == NULL) {
280 0 : talloc_free(user_info_dc);
281 0 : return NT_STATUS_NO_MEMORY;
282 80 : };
283 :
284 1099 : user_info_dc->lm_session_key = data_blob_talloc(user_info_dc, NULL, 16);
285 1099 : if (user_info_dc->lm_session_key.data == NULL) {
286 0 : talloc_free(user_info_dc);
287 0 : return NT_STATUS_NO_MEMORY;
288 80 : };
289 :
290 1099 : data_blob_clear(&user_info_dc->user_session_key);
291 1099 : data_blob_clear(&user_info_dc->lm_session_key);
292 :
293 1099 : user_info_dc->info = info = talloc_zero(user_info_dc, struct auth_user_info);
294 1099 : if (user_info_dc->info == NULL) {
295 0 : talloc_free(user_info_dc);
296 0 : return NT_STATUS_NO_MEMORY;
297 80 : };
298 :
299 1099 : info->account_name = talloc_strdup(info, "Administrator");
300 1099 : if (info->account_name == NULL) {
301 0 : talloc_free(user_info_dc);
302 0 : return NT_STATUS_NO_MEMORY;
303 80 : };
304 :
305 1099 : info->domain_name = talloc_strdup(info, domain_name);
306 1099 : if (info->domain_name == NULL) {
307 0 : talloc_free(user_info_dc);
308 0 : return NT_STATUS_NO_MEMORY;
309 80 : };
310 :
311 1099 : info->full_name = talloc_strdup(info, "Administrator");
312 1099 : if (info->full_name == NULL) {
313 0 : talloc_free(user_info_dc);
314 0 : return NT_STATUS_NO_MEMORY;
315 80 : };
316 :
317 1099 : info->logon_script = talloc_strdup(info, "");
318 1099 : if (info->logon_script == NULL) {
319 0 : talloc_free(user_info_dc);
320 0 : return NT_STATUS_NO_MEMORY;
321 80 : };
322 :
323 1099 : info->profile_path = talloc_strdup(info, "");
324 1099 : if (info->profile_path == NULL) {
325 0 : talloc_free(user_info_dc);
326 0 : return NT_STATUS_NO_MEMORY;
327 80 : };
328 :
329 1099 : info->home_directory = talloc_strdup(info, "");
330 1099 : if (info->home_directory == NULL) {
331 0 : talloc_free(user_info_dc);
332 0 : return NT_STATUS_NO_MEMORY;
333 80 : };
334 :
335 1099 : info->home_drive = talloc_strdup(info, "");
336 1099 : if (info->home_drive == NULL) {
337 0 : talloc_free(user_info_dc);
338 0 : return NT_STATUS_NO_MEMORY;
339 80 : };
340 :
341 1099 : info->logon_server = talloc_strdup(info, netbios_name);
342 1099 : if (info->logon_server == NULL) {
343 0 : talloc_free(user_info_dc);
344 0 : return NT_STATUS_NO_MEMORY;
345 80 : };
346 :
347 1099 : info->last_logon = 0;
348 1099 : info->last_logoff = 0;
349 1099 : info->acct_expiry = 0;
350 1099 : info->last_password_change = 0;
351 1099 : info->allow_password_change = 0;
352 1099 : info->force_password_change = 0;
353 :
354 1099 : info->logon_count = 0;
355 1099 : info->bad_password_count = 0;
356 :
357 1099 : info->acct_flags = ACB_NORMAL;
358 :
359 1099 : info->user_flags = 0;
360 :
361 1099 : *_user_info_dc = user_info_dc;
362 :
363 1099 : return NT_STATUS_OK;
364 : }
365 :
366 1099 : static NTSTATUS auth_domain_admin_session_info(TALLOC_CTX *parent_ctx,
367 : struct loadparm_context *lp_ctx,
368 : struct dom_sid *domain_sid,
369 : struct auth_session_info **session_info)
370 : {
371 80 : NTSTATUS nt_status;
372 1099 : struct auth_user_info_dc *user_info_dc = NULL;
373 1099 : TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
374 :
375 1099 : NT_STATUS_HAVE_NO_MEMORY(mem_ctx);
376 :
377 1099 : nt_status = auth_domain_admin_user_info_dc(mem_ctx,
378 : lpcfg_netbios_name(lp_ctx),
379 : lpcfg_workgroup(lp_ctx),
380 : domain_sid,
381 : &user_info_dc);
382 1099 : if (!NT_STATUS_IS_OK(nt_status)) {
383 0 : talloc_free(mem_ctx);
384 0 : return nt_status;
385 : }
386 :
387 1099 : nt_status = auth_generate_session_info(mem_ctx,
388 : lp_ctx,
389 : NULL /* sam_ctx */,
390 : user_info_dc,
391 : AUTH_SESSION_INFO_SIMPLE_PRIVILEGES|AUTH_SESSION_INFO_AUTHENTICATED|AUTH_SESSION_INFO_DEFAULT_GROUPS,
392 : session_info);
393 : /* There is already a reference between the session_info and user_info_dc */
394 1099 : if (NT_STATUS_IS_OK(nt_status)) {
395 1099 : talloc_steal(parent_ctx, *session_info);
396 : }
397 1099 : talloc_free(mem_ctx);
398 1099 : return nt_status;
399 : }
400 :
401 1099 : _PUBLIC_ struct auth_session_info *admin_session(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct dom_sid *domain_sid)
402 : {
403 80 : NTSTATUS nt_status;
404 1099 : struct auth_session_info *session_info = NULL;
405 1099 : nt_status = auth_domain_admin_session_info(mem_ctx,
406 : lp_ctx,
407 : domain_sid,
408 : &session_info);
409 1099 : if (!NT_STATUS_IS_OK(nt_status)) {
410 0 : return NULL;
411 : }
412 1099 : return session_info;
413 : }
414 :
415 39930 : _PUBLIC_ NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
416 : struct loadparm_context *lp_ctx,
417 : struct auth_session_info **_session_info)
418 : {
419 372 : NTSTATUS nt_status;
420 39930 : struct auth_user_info_dc *user_info_dc = NULL;
421 39930 : struct auth_session_info *session_info = NULL;
422 39930 : TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
423 372 : bool ok;
424 :
425 39930 : if (mem_ctx == NULL) {
426 0 : return NT_STATUS_NO_MEMORY;
427 : }
428 :
429 39930 : nt_status = auth_anonymous_user_info_dc(mem_ctx,
430 : lpcfg_netbios_name(lp_ctx),
431 : &user_info_dc);
432 39930 : if (!NT_STATUS_IS_OK(nt_status)) {
433 0 : talloc_free(mem_ctx);
434 0 : return nt_status;
435 : }
436 :
437 : /* references the user_info_dc into the session_info */
438 39930 : nt_status = auth_generate_session_info(parent_ctx,
439 : lp_ctx,
440 : NULL /* sam_ctx */,
441 : user_info_dc,
442 : AUTH_SESSION_INFO_SIMPLE_PRIVILEGES,
443 : &session_info);
444 39930 : talloc_free(mem_ctx);
445 :
446 39930 : NT_STATUS_NOT_OK_RETURN(nt_status);
447 :
448 39930 : session_info->credentials = cli_credentials_init(session_info);
449 39930 : if (!session_info->credentials) {
450 0 : talloc_free(session_info);
451 0 : return NT_STATUS_NO_MEMORY;
452 : }
453 :
454 39930 : ok = cli_credentials_set_conf(session_info->credentials, lp_ctx);
455 39930 : if (!ok) {
456 0 : talloc_free(session_info);
457 0 : return NT_STATUS_INTERNAL_ERROR;
458 : }
459 39930 : cli_credentials_set_anonymous(session_info->credentials);
460 :
461 39930 : *_session_info = session_info;
462 :
463 39930 : return NT_STATUS_OK;
464 : }
465 :
466 43787 : _PUBLIC_ NTSTATUS auth_anonymous_user_info_dc(TALLOC_CTX *mem_ctx,
467 : const char *netbios_name,
468 : struct auth_user_info_dc **_user_info_dc)
469 : {
470 703 : struct auth_user_info_dc *user_info_dc;
471 703 : struct auth_user_info *info;
472 43787 : user_info_dc = talloc_zero(mem_ctx, struct auth_user_info_dc);
473 43787 : NT_STATUS_HAVE_NO_MEMORY(user_info_dc);
474 :
475 : /* This returns a pointer to a struct dom_sid, which is the
476 : * same as a 1 element list of struct dom_sid */
477 43787 : user_info_dc->num_sids = 1;
478 43787 : user_info_dc->sids = talloc(user_info_dc, struct auth_SidAttr);
479 43787 : if (user_info_dc->sids == NULL) {
480 0 : talloc_free(user_info_dc);
481 0 : return NT_STATUS_NO_MEMORY;
482 703 : };
483 :
484 43787 : user_info_dc->sids->sid = global_sid_Anonymous;
485 43787 : user_info_dc->sids->attrs = SE_GROUP_DEFAULT_FLAGS;
486 :
487 : /* annoying, but the Anonymous really does have a session key... */
488 43787 : user_info_dc->user_session_key = data_blob_talloc(user_info_dc, NULL, 16);
489 43787 : if (user_info_dc->user_session_key.data == NULL) {
490 0 : talloc_free(user_info_dc);
491 0 : return NT_STATUS_NO_MEMORY;
492 703 : };
493 :
494 43787 : user_info_dc->lm_session_key = data_blob_talloc(user_info_dc, NULL, 16);
495 43787 : if (user_info_dc->lm_session_key.data == NULL) {
496 0 : talloc_free(user_info_dc);
497 0 : return NT_STATUS_NO_MEMORY;
498 703 : };
499 :
500 : /* and it is all zeros! */
501 43787 : data_blob_clear(&user_info_dc->user_session_key);
502 43787 : data_blob_clear(&user_info_dc->lm_session_key);
503 :
504 43787 : user_info_dc->info = info = talloc_zero(user_info_dc, struct auth_user_info);
505 43787 : if (user_info_dc->info == NULL) {
506 0 : talloc_free(user_info_dc);
507 0 : return NT_STATUS_NO_MEMORY;
508 703 : };
509 :
510 43787 : info->account_name = talloc_strdup(info, "ANONYMOUS LOGON");
511 43787 : if (info->account_name == NULL) {
512 0 : talloc_free(user_info_dc);
513 0 : return NT_STATUS_NO_MEMORY;
514 703 : };
515 :
516 43787 : info->domain_name = talloc_strdup(info, "NT AUTHORITY");
517 43787 : if (info->domain_name == NULL) {
518 0 : talloc_free(user_info_dc);
519 0 : return NT_STATUS_NO_MEMORY;
520 703 : };
521 :
522 43787 : info->full_name = talloc_strdup(info, "Anonymous Logon");
523 43787 : if (info->full_name == NULL) {
524 0 : talloc_free(user_info_dc);
525 0 : return NT_STATUS_NO_MEMORY;
526 703 : };
527 :
528 43787 : info->logon_script = talloc_strdup(info, "");
529 43787 : if (info->logon_script == NULL) {
530 0 : talloc_free(user_info_dc);
531 0 : return NT_STATUS_NO_MEMORY;
532 703 : };
533 :
534 43787 : info->profile_path = talloc_strdup(info, "");
535 43787 : if (info->profile_path == NULL) {
536 0 : talloc_free(user_info_dc);
537 0 : return NT_STATUS_NO_MEMORY;
538 703 : };
539 :
540 43787 : info->home_directory = talloc_strdup(info, "");
541 43787 : if (info->home_directory == NULL) {
542 0 : talloc_free(user_info_dc);
543 0 : return NT_STATUS_NO_MEMORY;
544 703 : };
545 :
546 43787 : info->home_drive = talloc_strdup(info, "");
547 43787 : if (info->home_drive == NULL) {
548 0 : talloc_free(user_info_dc);
549 0 : return NT_STATUS_NO_MEMORY;
550 703 : };
551 :
552 43787 : info->logon_server = talloc_strdup(info, netbios_name);
553 43787 : if (info->logon_server == NULL) {
554 0 : talloc_free(user_info_dc);
555 0 : return NT_STATUS_NO_MEMORY;
556 703 : };
557 :
558 43787 : info->last_logon = 0;
559 43787 : info->last_logoff = 0;
560 43787 : info->acct_expiry = 0;
561 43787 : info->last_password_change = 0;
562 43787 : info->allow_password_change = 0;
563 43787 : info->force_password_change = 0;
564 :
565 43787 : info->logon_count = 0;
566 43787 : info->bad_password_count = 0;
567 :
568 43787 : info->acct_flags = ACB_NORMAL;
569 :
570 : /* The user is not authenticated. */
571 43787 : info->user_flags = NETLOGON_GUEST;
572 :
573 43787 : *_user_info_dc = user_info_dc;
574 :
575 43787 : return NT_STATUS_OK;
576 : }
577 :
|