r585: merge of fix for KB828741 -- pw chg -- from 3.0
[Samba.git] / source / rpc_server / srv_lsa_nt.c
blobc216b6ddf890e2d277ac3f29dd2ef3b03b696948
1 /*
2 * Unix SMB/Netbios implementation.
3 * Version 1.9.
4 * RPC Pipe client / server routines
5 * Copyright (C) Andrew Tridgell 1992-1997,
6 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
7 * Copyright (C) Paul Ashton 1997.
8 * Copyright (C) Jeremy Allison 2001.
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 2 of the License, or
13 * (at your option) any later version.
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.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /* This is the implementation of the lsa server code. */
27 #include "includes.h"
29 extern DOM_SID global_sam_sid;
30 extern fstring global_myworkgroup;
31 extern pstring global_myname;
33 static PRIVS privs[] = {
34 {SE_PRIV_NONE, "no_privs", "No privilege"},
35 {SE_PRIV_ADD_USERS, "add_users", "add users"},
36 {SE_PRIV_ADD_MACHINES, "add_computers", "add computers to domain"},
37 {SE_PRIV_PRINT_OPERATOR, "print_op", "printer operator"},
38 {SE_PRIV_ALL, "all_privs", "all privileges"}
41 struct lsa_info {
42 DOM_SID sid;
43 uint32 access;
46 /*******************************************************************
47 Function to free the per handle data.
48 ********************************************************************/
50 static void free_lsa_info(void *ptr)
52 struct lsa_info *lsa = (struct lsa_info *)ptr;
54 SAFE_FREE(lsa);
57 /***************************************************************************
58 Init dom_query
59 ***************************************************************************/
61 static void init_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid)
63 int domlen = (dom_name != NULL) ? strlen(dom_name) : 0;
66 * I'm not sure why this really odd combination of length
67 * values works, but it does appear to. I need to look at
68 * this *much* more closely - but at the moment leave alone
69 * until it's understood. This allows a W2k client to join
70 * a domain with both odd and even length names... JRA.
73 d_q->uni_dom_str_len = domlen ? ((domlen + 1) * 2) : 0;
74 d_q->uni_dom_max_len = domlen * 2;
75 d_q->buffer_dom_name = domlen != 0 ? 1 : 0; /* domain buffer pointer */
76 d_q->buffer_dom_sid = dom_sid != NULL ? 1 : 0; /* domain sid pointer */
78 /* this string is supposed to be character short */
79 init_unistr2(&d_q->uni_domain_name, dom_name, domlen);
80 d_q->uni_domain_name.uni_max_len++;
82 if (dom_sid != NULL)
83 init_dom_sid2(&d_q->dom_sid, dom_sid);
86 /***************************************************************************
87 init_dom_ref - adds a domain if it's not already in, returns the index.
88 ***************************************************************************/
90 static int init_dom_ref(DOM_R_REF *ref, char *dom_name, DOM_SID *dom_sid)
92 int num = 0;
93 int len;
95 if (dom_name != NULL) {
96 for (num = 0; num < ref->num_ref_doms_1; num++) {
97 fstring domname;
98 fstrcpy(domname, dos_unistr2_to_str(&ref->ref_dom[num].uni_dom_name));
99 if (strequal(domname, dom_name))
100 return num;
102 } else {
103 num = ref->num_ref_doms_1;
106 if (num >= MAX_REF_DOMAINS) {
107 /* index not found, already at maximum domain limit */
108 return -1;
111 ref->num_ref_doms_1 = num+1;
112 ref->ptr_ref_dom = 1;
113 ref->max_entries = MAX_REF_DOMAINS;
114 ref->num_ref_doms_2 = num+1;
116 len = (dom_name != NULL) ? strlen(dom_name) : 0;
117 if(dom_name != NULL && len == 0)
118 len = 1;
120 init_uni_hdr(&ref->hdr_ref_dom[num].hdr_dom_name, len);
121 ref->hdr_ref_dom[num].ptr_dom_sid = dom_sid != NULL ? 1 : 0;
123 init_unistr2(&ref->ref_dom[num].uni_dom_name, dom_name, len);
124 init_dom_sid2(&ref->ref_dom[num].ref_dom, dom_sid );
126 return num;
129 /***************************************************************************
130 init_lsa_rid2s
131 ***************************************************************************/
133 static void init_lsa_rid2s(DOM_R_REF *ref, DOM_RID2 *rid2,
134 int num_entries, UNISTR2 *name,
135 uint32 *mapped_count, BOOL endian)
137 int i;
138 int total = 0;
139 *mapped_count = 0;
141 SMB_ASSERT(num_entries <= MAX_LOOKUP_SIDS);
143 for (i = 0; i < num_entries; i++) {
144 BOOL status = False;
145 DOM_SID sid;
146 uint32 rid = 0xffffffff;
147 int dom_idx = -1;
148 pstring full_name;
149 fstring dom_name, user;
150 enum SID_NAME_USE name_type = SID_NAME_UNKNOWN;
152 /* Split name into domain and user component */
154 pstrcpy(full_name, dos_unistr2_to_str(&name[i]));
155 dos_to_unix(full_name); /* full name should be in unix charset. */
156 split_domain_name(full_name, dom_name, user);
158 /* Lookup name */
160 DEBUG(5, ("init_lsa_rid2s: looking up name %s\n", full_name));
162 status = lookup_name(full_name, &sid, &name_type);
164 DEBUG(5, ("init_lsa_rid2s: %s\n", status ? "found" :
165 "not found"));
167 if (status) {
168 sid_split_rid(&sid, &rid);
169 dom_idx = init_dom_ref(ref, dom_name, &sid);
170 (*mapped_count)++;
171 } else {
172 dom_idx = -1;
173 rid = 0xffffffff;
174 name_type = SID_NAME_UNKNOWN;
177 init_dom_rid2(&rid2[total], rid, name_type, dom_idx);
178 total++;
182 /***************************************************************************
183 init_reply_lookup_names
184 ***************************************************************************/
186 static void init_reply_lookup_names(LSA_R_LOOKUP_NAMES *r_l,
187 DOM_R_REF *ref, uint32 num_entries,
188 DOM_RID2 *rid2, uint32 mapped_count)
190 r_l->ptr_dom_ref = 1;
191 r_l->dom_ref = ref;
193 r_l->num_entries = num_entries;
194 r_l->ptr_entries = 1;
195 r_l->num_entries2 = num_entries;
196 r_l->dom_rid = rid2;
198 r_l->mapped_count = mapped_count;
200 if (mapped_count == 0)
201 r_l->status = NT_STATUS_NONE_MAPPED;
202 else
203 r_l->status = NT_STATUS_OK;
206 /***************************************************************************
207 Init lsa_trans_names.
208 ***************************************************************************/
210 static void init_lsa_trans_names(TALLOC_CTX *ctx, DOM_R_REF *ref, LSA_TRANS_NAME_ENUM *trn,
211 int num_entries, DOM_SID2 *sid,
212 uint32 *mapped_count)
214 int i;
215 int total = 0;
216 *mapped_count = 0;
218 /* Allocate memory for list of names */
220 if (num_entries > 0) {
221 if (!(trn->name = (LSA_TRANS_NAME *)talloc(ctx, sizeof(LSA_TRANS_NAME) *
222 num_entries))) {
223 DEBUG(0, ("init_lsa_trans_names(): out of memory\n"));
224 return;
227 if (!(trn->uni_name = (UNISTR2 *)talloc(ctx, sizeof(UNISTR2) *
228 num_entries))) {
229 DEBUG(0, ("init_lsa_trans_names(): out of memory\n"));
230 return;
234 for (i = 0; i < num_entries; i++) {
235 BOOL status = False;
236 DOM_SID find_sid = sid[i].sid;
237 uint32 rid = 0xffffffff;
238 int dom_idx = -1;
239 fstring name, dom_name;
240 enum SID_NAME_USE sid_name_use = (enum SID_NAME_USE)0;
242 sid_to_string(name, &find_sid);
243 DEBUG(5, ("init_lsa_trans_names: looking up sid %s\n", name));
245 /* Lookup sid from winbindd */
247 memset(dom_name, '\0', sizeof(dom_name));
248 memset(name, '\0', sizeof(name));
250 status = lookup_sid(&find_sid, dom_name, name, &sid_name_use);
252 DEBUG(5, ("init_lsa_trans_names: %s\n", status ? "found" :
253 "not found"));
255 if (!status) {
256 sid_name_use = SID_NAME_UNKNOWN;
259 /* Store domain sid in ref array */
261 if (find_sid.num_auths == 5) {
262 sid_split_rid(&find_sid, &rid);
265 /* unistr routines take dos codepage strings */
267 unix_to_dos(dom_name);
268 unix_to_dos(name);
270 dom_idx = init_dom_ref(ref, dom_name, &find_sid);
272 DEBUG(10,("init_lsa_trans_names: added user '%s\\%s' to "
273 "referenced list.\n", dom_name, name ));
275 (*mapped_count)++;
277 init_lsa_trans_name(&trn->name[total], &trn->uni_name[total],
278 sid_name_use, name, dom_idx);
279 total++;
282 trn->num_entries = total;
283 trn->ptr_trans_names = 1;
284 trn->num_entries2 = total;
287 /***************************************************************************
288 Init_reply_lookup_sids.
289 ***************************************************************************/
291 static void init_reply_lookup_sids(LSA_R_LOOKUP_SIDS *r_l,
292 DOM_R_REF *ref, LSA_TRANS_NAME_ENUM *names,
293 uint32 mapped_count)
295 r_l->ptr_dom_ref = 1;
296 r_l->dom_ref = ref;
297 r_l->names = names;
298 r_l->mapped_count = mapped_count;
300 if (mapped_count == 0)
301 r_l->status = NT_STATUS_NONE_MAPPED;
302 else
303 r_l->status = NT_STATUS_OK;
306 /***************************************************************************
307 _lsa_open_policy2.
308 ***************************************************************************/
310 NTSTATUS _lsa_open_policy2(pipes_struct *p, LSA_Q_OPEN_POL2 *q_u, LSA_R_OPEN_POL2 *r_u)
312 /* lkclXXXX having decoded it, ignore all fields in the open policy! */
314 /* set up the LSA QUERY INFO response */
315 if (!create_policy_hnd(p, &r_u->pol, NULL, NULL))
316 return NT_STATUS_OBJECT_NAME_NOT_FOUND;
318 return NT_STATUS_OK;
321 /***************************************************************************
322 _lsa_open_policy
323 ***************************************************************************/
325 NTSTATUS _lsa_open_policy(pipes_struct *p, LSA_Q_OPEN_POL *q_u, LSA_R_OPEN_POL *r_u)
327 /* lkclXXXX having decoded it, ignore all fields in the open policy! */
329 /* set up the LSA QUERY INFO response */
330 if (!create_policy_hnd(p, &r_u->pol, NULL, NULL))
331 return NT_STATUS_OBJECT_NAME_NOT_FOUND;
333 return NT_STATUS_OK;
336 /***************************************************************************
337 _lsa_enum_trust_dom - this needs fixing to do more than return NULL ! JRA.
338 ***************************************************************************/
340 NTSTATUS _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENUM_TRUST_DOM *r_u)
342 uint32 enum_context = 0;
343 char *dom_name = NULL;
344 DOM_SID *dom_sid = NULL;
346 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
347 return NT_STATUS_INVALID_HANDLE;
349 /* set up the LSA QUERY INFO response */
350 init_r_enum_trust_dom(p->mem_ctx, r_u, enum_context, dom_name, dom_sid,
351 dom_name != NULL ? NT_STATUS_OK : NT_STATUS_NO_MORE_ENTRIES);
353 return r_u->status;
356 /***************************************************************************
357 _lsa_query_info. See the POLICY_INFOMATION_CLASS docs at msdn.
358 ***************************************************************************/
360 NTSTATUS _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INFO *r_u)
362 LSA_INFO_UNION *info = &r_u->dom;
363 DOM_SID domain_sid;
364 fstring dos_domain;
365 fstring dos_myname;
366 char *name = NULL;
367 DOM_SID *sid = NULL;
369 r_u->status = NT_STATUS_OK;
371 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
372 return NT_STATUS_INVALID_HANDLE;
374 fstrcpy(dos_myname, global_myname);
375 unix_to_dos(dos_myname);
377 fstrcpy(dos_domain, global_myworkgroup);
378 unix_to_dos(dos_domain);
380 switch (q_u->info_class) {
381 case 0x02:
383 unsigned int i;
384 /* fake info: We audit everything. ;) */
385 info->id2.auditing_enabled = 1;
386 info->id2.count1 = 7;
387 info->id2.count2 = 7;
388 if ((info->id2.auditsettings = (uint32 *)talloc(p->mem_ctx,7*sizeof(uint32))) == NULL)
389 return NT_STATUS_NO_MEMORY;
390 for (i = 0; i < 7; i++)
391 info->id2.auditsettings[i] = 3;
392 break;
394 case 0x03:
395 /* Request PolicyPrimaryDomainInformation. */
396 switch (lp_server_role()) {
397 case ROLE_DOMAIN_PDC:
398 case ROLE_DOMAIN_BDC:
399 name = dos_domain;
400 sid = &global_sam_sid;
401 break;
402 case ROLE_DOMAIN_MEMBER:
403 name = dos_domain;
404 /* We need to return the Domain SID here. */
405 if (secrets_fetch_domain_sid(dos_domain,
406 &domain_sid))
407 sid = &domain_sid;
408 else
409 return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
410 break;
411 case ROLE_STANDALONE:
412 name = dos_domain;
413 sid = NULL;
414 break;
415 default:
416 return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
418 init_dom_query(&r_u->dom.id3, name, sid);
419 break;
420 case 0x05:
421 /* Request PolicyAccountDomainInformation. */
422 switch (lp_server_role()) {
423 case ROLE_DOMAIN_PDC:
424 case ROLE_DOMAIN_BDC:
425 name = dos_domain;
426 sid = &global_sam_sid;
427 break;
428 case ROLE_DOMAIN_MEMBER:
429 name = dos_myname;
430 sid = &global_sam_sid;
431 break;
432 case ROLE_STANDALONE:
433 name = dos_myname;
434 sid = &global_sam_sid;
435 break;
436 default:
437 return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
439 init_dom_query(&r_u->dom.id5, name, sid);
440 break;
441 case 0x06:
442 switch (lp_server_role()) {
443 case ROLE_DOMAIN_BDC:
445 * only a BDC is a backup controller
446 * of the domain, it controls.
448 info->id6.server_role = 2;
449 break;
450 default:
452 * any other role is a primary
453 * of the domain, it controls.
455 info->id6.server_role = 3;
456 break;
458 break;
459 default:
460 DEBUG(0,("_lsa_query_info: unknown info level in Lsa Query: %d\n", q_u->info_class));
461 r_u->status = NT_STATUS_INVALID_INFO_CLASS;
462 break;
465 if (NT_STATUS_IS_OK(r_u->status)) {
466 r_u->undoc_buffer = 0x22000000; /* bizarre */
467 r_u->info_class = q_u->info_class;
470 return r_u->status;
473 /***************************************************************************
474 _lsa_lookup_sids
475 ***************************************************************************/
477 NTSTATUS _lsa_lookup_sids(pipes_struct *p, LSA_Q_LOOKUP_SIDS *q_u, LSA_R_LOOKUP_SIDS *r_u)
479 DOM_SID2 *sid = q_u->sids.sid;
480 int num_entries = q_u->sids.num_entries;
481 DOM_R_REF *ref = NULL;
482 LSA_TRANS_NAME_ENUM *names = NULL;
483 uint32 mapped_count = 0;
485 ref = (DOM_R_REF *)talloc_zero(p->mem_ctx, sizeof(DOM_R_REF));
486 names = (LSA_TRANS_NAME_ENUM *)talloc_zero(p->mem_ctx, sizeof(LSA_TRANS_NAME_ENUM));
488 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
489 r_u->status = NT_STATUS_INVALID_HANDLE;
491 if ((!ref || !names) && NT_STATUS_IS_OK(r_u->status))
492 r_u->status = NT_STATUS_NO_MEMORY;
494 /* set up the LSA Lookup SIDs response */
495 init_lsa_trans_names(p->mem_ctx, ref, names, num_entries, sid, &mapped_count);
496 init_reply_lookup_sids(r_u, ref, names, mapped_count);
498 return r_u->status;
501 /***************************************************************************
502 lsa_reply_lookup_names
503 ***************************************************************************/
505 NTSTATUS _lsa_lookup_names(pipes_struct *p,LSA_Q_LOOKUP_NAMES *q_u, LSA_R_LOOKUP_NAMES *r_u)
507 UNISTR2 *names = q_u->uni_name;
508 int num_entries = q_u->num_entries;
509 DOM_R_REF *ref;
510 DOM_RID2 *rids;
511 uint32 mapped_count = 0;
513 ref = (DOM_R_REF *)talloc_zero(p->mem_ctx, sizeof(DOM_R_REF));
514 rids = (DOM_RID2 *)talloc_zero(p->mem_ctx, sizeof(DOM_RID2)*MAX_LOOKUP_SIDS);
516 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
517 r_u->status = NT_STATUS_INVALID_HANDLE;
519 if ((!ref || !rids) && NT_STATUS_IS_OK(r_u->status))
520 r_u->status = NT_STATUS_NO_MEMORY;
522 /* set up the LSA Lookup RIDs response */
523 init_lsa_rid2s(ref, rids, num_entries, names, &mapped_count, p->endian);
524 init_reply_lookup_names(r_u, ref, num_entries, rids, mapped_count);
526 return r_u->status;
529 /***************************************************************************
530 _lsa_close. Also weird - needs to check if lsa handle is correct. JRA.
531 ***************************************************************************/
533 NTSTATUS _lsa_close(pipes_struct *p, LSA_Q_CLOSE *q_u, LSA_R_CLOSE *r_u)
535 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
536 return NT_STATUS_INVALID_HANDLE;
538 close_policy_hnd(p, &q_u->pol);
539 return NT_STATUS_OK;
542 /***************************************************************************
543 "No more secrets Marty...." :-).
544 ***************************************************************************/
546 NTSTATUS _lsa_open_secret(pipes_struct *p, LSA_Q_OPEN_SECRET *q_u, LSA_R_OPEN_SECRET *r_u)
548 return NT_STATUS_OBJECT_NAME_NOT_FOUND;
551 /***************************************************************************
552 _lsa_enum_privs.
553 ***************************************************************************/
555 NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIVS *r_u)
557 uint32 i;
559 uint32 enum_context=q_u->enum_context;
560 LSA_PRIV_ENTRY *entry;
561 LSA_PRIV_ENTRY *entries;
563 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
564 return NT_STATUS_INVALID_HANDLE;
566 if (enum_context >= PRIV_ALL_INDEX)
567 return NT_STATUS_UNABLE_TO_FREE_VM;
569 entries = (LSA_PRIV_ENTRY *)talloc_zero(p->mem_ctx, sizeof(LSA_PRIV_ENTRY) * (PRIV_ALL_INDEX-enum_context));
570 if (entries==NULL)
571 return NT_STATUS_NO_MEMORY;
573 entry = entries;
574 for (i = 0; i < PRIV_ALL_INDEX-enum_context; i++, entry++) {
575 init_uni_hdr(&entry->hdr_name, strlen(privs[i+1-enum_context].priv));
576 init_unistr2(&entry->name, privs[i+1-enum_context].priv, strlen(privs[i+1-enum_context].priv) );
577 entry->luid_low = privs[i+1-enum_context].se_priv;
578 entry->luid_high = 1;
581 init_lsa_r_enum_privs(r_u, i+enum_context, PRIV_ALL_INDEX-enum_context, entries);
583 return NT_STATUS_OK;
586 /***************************************************************************
587 _lsa_priv_get_dispname.
588 ***************************************************************************/
590 NTSTATUS _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, LSA_R_PRIV_GET_DISPNAME *r_u)
592 fstring name_asc;
593 fstring desc_asc;
594 int i;
596 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
597 return NT_STATUS_INVALID_HANDLE;
599 unistr2_to_dos(name_asc, &q_u->name, sizeof(name_asc));
601 DEBUG(0,("_lsa_priv_get_dispname: %s", name_asc));
603 for (i=1; privs[i].se_priv!=SE_PRIV_ALL; i++) {
604 if ( strcmp(name_asc, privs[i].priv)) {
606 fstrcpy(desc_asc, privs[i].description);
610 DEBUG(0,(": %s\n", desc_asc));
612 init_uni_hdr(&r_u->hdr_desc, strlen(desc_asc));
613 init_unistr2(&r_u->desc, desc_asc, strlen(desc_asc) );
615 r_u->ptr_info=0xdeadbeef;
616 r_u->lang_id=q_u->lang_id;
618 return NT_STATUS_OK;
621 NTSTATUS _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA_R_UNK_GET_CONNUSER *r_u)
623 fstring username, domname;
624 int ulen, dlen;
625 user_struct *vuser = get_valid_user_struct(p->vuid);
627 if (vuser == NULL)
628 return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
630 fstrcpy(username, vuser->user.smb_name);
631 fstrcpy(domname, vuser->user.domain);
633 ulen = strlen(username) + 1;
634 dlen = strlen(domname) + 1;
636 init_uni_hdr(&r_u->hdr_user_name, ulen);
637 r_u->ptr_user_name = 1;
638 init_unistr2(&r_u->uni2_user_name, username, ulen);
640 r_u->unk1 = 1;
642 init_uni_hdr(&r_u->hdr_dom_name, dlen);
643 r_u->ptr_dom_name = 1;
644 init_unistr2(&r_u->uni2_dom_name, domname, dlen);
646 r_u->status = NT_STATUS_OK;
648 return r_u->status;
651 /***************************************************************************
653 ***************************************************************************/
655 NTSTATUS _lsa_open_account(pipes_struct *p, LSA_Q_OPENACCOUNT *q_u, LSA_R_OPENACCOUNT *r_u)
657 struct lsa_info *info;
659 r_u->status = NT_STATUS_OK;
661 /* find the connection policy handle. */
662 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
663 return NT_STATUS_INVALID_HANDLE;
665 /* associate the user/group SID with the (unique) handle. */
666 if ((info = (struct lsa_info *)malloc(sizeof(struct lsa_info))) == NULL)
667 return NT_STATUS_NO_MEMORY;
669 ZERO_STRUCTP(info);
670 info->sid = q_u->sid.sid;
671 info->access = q_u->access;
673 /* get a (unique) handle. open a policy on it. */
674 if (!create_policy_hnd(p, &r_u->pol, free_lsa_info, (void *)info))
675 return NT_STATUS_OBJECT_NAME_NOT_FOUND;
677 return r_u->status;
680 /***************************************************************************
682 ***************************************************************************/
684 NTSTATUS _lsa_getsystemaccount(pipes_struct *p, LSA_Q_GETSYSTEMACCOUNT *q_u, LSA_R_GETSYSTEMACCOUNT *r_u)
686 r_u->status = NT_STATUS_OK;
688 /* find the connection policy handle. */
689 if (!find_policy_by_hnd(p, &q_u->pol, NULL))
690 return NT_STATUS_INVALID_HANDLE;
692 r_u->access=3;
694 return r_u->status;