3 * Unix SMB/Netbios implementation.
5 * RPC Pipe client / server routines
6 * Copyright (C) Andrew Tridgell 1992-1997,
7 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
8 * Copyright (C) Paul Ashton 1997.
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.
29 extern int DEBUGLEVEL;
31 extern BOOL sam_logon_in_ssb;
32 extern pstring samlogon_user;
33 extern pstring global_myworkgroup;
34 extern pstring global_myname;
35 extern DOM_SID global_sam_sid;
37 extern rid_name domain_group_rids[];
38 extern rid_name domain_alias_rids[];
39 extern rid_name builtin_alias_rids[];
41 /*******************************************************************
42 This next function should be replaced with something that
43 dynamically returns the correct user info..... JRA.
44 ********************************************************************/
46 static BOOL get_sampwd_entries(SAM_USER_INFO_21 *pw_buf,
48 int *total_entries, int *num_entries,
53 struct sam_passwd *pwd = NULL;
58 if (pw_buf == NULL) return False;
60 vp = startsmbpwent(False);
63 DEBUG(0, ("get_sampwd_entries: Unable to open SMB password database.\n"));
67 while (((pwd = getsam21pwent(vp)) != NULL) && (*num_entries) < max_num_entries)
73 /* skip the requested number of entries.
74 not very efficient, but hey...
80 user_name_len = strlen(pwd->smb_name);
81 make_unistr2(&(pw_buf[(*num_entries)].uni_user_name), pwd->smb_name, user_name_len-1);
82 make_uni_hdr(&(pw_buf[(*num_entries)].hdr_user_name), user_name_len-1,
84 pw_buf[(*num_entries)].user_rid = pwd->user_rid;
85 bzero( pw_buf[(*num_entries)].nt_pwd , 16);
87 /* Now check if the NT compatible password is available. */
88 if (pwd->smb_nt_passwd != NULL)
90 memcpy( pw_buf[(*num_entries)].nt_pwd , pwd->smb_nt_passwd, 16);
93 pw_buf[(*num_entries)].acb_info = (uint16)pwd->acct_ctrl;
95 DEBUG(5, ("entry idx: %d user %s, rid 0x%x, acb %x",
96 (*num_entries), pwd->smb_name,
97 pwd->user_rid, pwd->acct_ctrl));
99 if (acb_mask == 0 || IS_BITS_SET_SOME(pwd->acct_ctrl, acb_mask))
101 DEBUG(5,(" acb_mask %x accepts\n", acb_mask));
106 DEBUG(5,(" acb_mask %x rejects\n", acb_mask));
114 return (*num_entries) > 0;
117 /*******************************************************************
119 ********************************************************************/
120 static void samr_reply_close_hnd(SAMR_Q_CLOSE_HND *q_u,
123 SAMR_R_CLOSE_HND r_u;
125 /* set up the SAMR unknown_1 response */
126 bzero(r_u.pol.data, POL_HND_SIZE);
128 /* close the policy handle */
129 if (close_lsa_policy_hnd(&(q_u->pol)))
135 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_INVALID;
138 DEBUG(5,("samr_reply_close_hnd: %d\n", __LINE__));
140 /* store the response in the SMB stream */
141 samr_io_r_close_hnd("", &r_u, rdata, 0);
143 DEBUG(5,("samr_reply_close_hnd: %d\n", __LINE__));
147 /*******************************************************************
149 ********************************************************************/
150 static void api_samr_close_hnd( uint16 vuid, prs_struct *data, prs_struct *rdata)
152 SAMR_Q_CLOSE_HND q_u;
154 /* grab the samr unknown 1 */
155 samr_io_q_close_hnd("", &q_u, data, 0);
157 /* construct reply. always indicate success */
158 samr_reply_close_hnd(&q_u, rdata);
162 /*******************************************************************
163 samr_reply_open_domain
164 ********************************************************************/
165 static void samr_reply_open_domain(SAMR_Q_OPEN_DOMAIN *q_u,
168 SAMR_R_OPEN_DOMAIN r_u;
169 BOOL pol_open = False;
173 /* find the connection policy handle. */
174 if (r_u.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->connect_pol)) == -1))
176 r_u.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
179 /* get a (unique) handle. open a policy on it. */
180 if (r_u.status == 0x0 && !(pol_open = open_lsa_policy_hnd(&(r_u.domain_pol))))
182 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
185 /* associate the domain SID with the (unique) handle. */
186 if (r_u.status == 0x0 && !set_lsa_policy_samr_sid(&(r_u.domain_pol), &(q_u->dom_sid.sid)))
188 /* oh, whoops. don't know what error message to return, here */
189 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
192 if (r_u.status != 0 && pol_open)
194 close_lsa_policy_hnd(&(r_u.domain_pol));
197 DEBUG(5,("samr_open_domain: %d\n", __LINE__));
199 /* store the response in the SMB stream */
200 samr_io_r_open_domain("", &r_u, rdata, 0);
202 DEBUG(5,("samr_open_domain: %d\n", __LINE__));
206 /*******************************************************************
208 ********************************************************************/
209 static void api_samr_open_domain( uint16 vuid, prs_struct *data, prs_struct *rdata)
211 SAMR_Q_OPEN_DOMAIN q_u;
213 /* grab the samr open */
214 samr_io_q_open_domain("", &q_u, data, 0);
216 /* construct reply. always indicate success */
217 samr_reply_open_domain(&q_u, rdata);
221 /*******************************************************************
222 samr_reply_unknown_2c
223 ********************************************************************/
224 static void samr_reply_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u,
227 SAMR_R_UNKNOWN_2C r_u;
231 /* find the policy handle. open a policy on it. */
232 if (status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->user_pol)) == -1))
234 status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
237 /* find the user's rid */
238 if (status == 0x0 && (rid = get_lsa_policy_samr_rid(&(q_u->user_pol))) == 0xffffffff)
240 status = NT_STATUS_OBJECT_TYPE_MISMATCH;
243 make_samr_r_unknown_2c(&r_u, status);
245 DEBUG(5,("samr_unknown_2c: %d\n", __LINE__));
247 /* store the response in the SMB stream */
248 samr_io_r_unknown_2c("", &r_u, rdata, 0);
250 DEBUG(5,("samr_unknown_2c: %d\n", __LINE__));
254 /*******************************************************************
256 ********************************************************************/
257 static void api_samr_unknown_2c( uint16 vuid, prs_struct *data, prs_struct *rdata)
259 SAMR_Q_UNKNOWN_2C q_u;
261 /* grab the samr open */
262 samr_io_q_unknown_2c("", &q_u, data, 0);
264 /* construct reply. always indicate success */
265 samr_reply_unknown_2c(&q_u, rdata);
269 /*******************************************************************
271 ********************************************************************/
272 static void samr_reply_unknown_3(SAMR_Q_UNKNOWN_3 *q_u,
275 SAMR_R_UNKNOWN_3 r_u;
276 DOM_SID3 sid[MAX_SAM_SIDS];
282 /* find the policy handle. open a policy on it. */
283 if (status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->user_pol)) == -1))
285 status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
288 /* find the user's rid */
289 if (status == 0x0 && (rid = get_lsa_policy_samr_rid(&(q_u->user_pol))) == 0xffffffff)
291 status = NT_STATUS_OBJECT_TYPE_MISMATCH;
297 DOM_SID everyone_sid;
299 user_sid = global_sam_sid;
301 SMB_ASSERT_ARRAY(user_sid.sub_auths, user_sid.num_auths+1);
306 user_sid.sub_auths[user_sid.num_auths++] = rid;
308 string_to_sid(&everyone_sid, "S-1-1");
310 /* maybe need another 1 or 2 (S-1-5-20-0x220 and S-1-5-20-0x224) */
311 /* these two are DOMAIN_ADMIN and DOMAIN_ACCT_OP group RIDs */
312 make_dom_sid3(&(sid[0]), 0x035b, 0x0002, &everyone_sid);
313 make_dom_sid3(&(sid[1]), 0x0044, 0x0002, &user_sid);
316 make_samr_r_unknown_3(&r_u,
318 0x00000014, 0x0002, 0x0070,
321 DEBUG(5,("samr_unknown_3: %d\n", __LINE__));
323 /* store the response in the SMB stream */
324 samr_io_r_unknown_3("", &r_u, rdata, 0);
326 DEBUG(5,("samr_unknown_3: %d\n", __LINE__));
330 /*******************************************************************
332 ********************************************************************/
333 static void api_samr_unknown_3( uint16 vuid, prs_struct *data, prs_struct *rdata)
335 SAMR_Q_UNKNOWN_3 q_u;
337 /* grab the samr open */
338 samr_io_q_unknown_3("", &q_u, data, 0);
340 /* construct reply. always indicate success */
341 samr_reply_unknown_3(&q_u, rdata);
345 /*******************************************************************
346 samr_reply_enum_dom_users
347 ********************************************************************/
348 static void samr_reply_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_u,
351 SAMR_R_ENUM_DOM_USERS r_e;
352 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES];
357 r_e.total_num_entries = 0;
359 /* find the policy handle. open a policy on it. */
360 if (r_e.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
362 r_e.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
365 DEBUG(5,("samr_reply_enum_dom_users: %d\n", __LINE__));
368 get_sampwd_entries(pass, 0, &total_entries, &num_entries, MAX_SAM_ENTRIES, q_u->acb_mask);
371 make_samr_r_enum_dom_users(&r_e, total_entries,
372 q_u->unknown_0, num_entries,
375 /* store the response in the SMB stream */
376 samr_io_r_enum_dom_users("", &r_e, rdata, 0);
378 DEBUG(5,("samr_enum_dom_users: %d\n", __LINE__));
382 /*******************************************************************
383 api_samr_enum_dom_users
384 ********************************************************************/
385 static void api_samr_enum_dom_users( uint16 vuid, prs_struct *data, prs_struct *rdata)
387 SAMR_Q_ENUM_DOM_USERS q_e;
389 /* grab the samr open */
390 samr_io_q_enum_dom_users("", &q_e, data, 0);
392 /* construct reply. */
393 samr_reply_enum_dom_users(&q_e, rdata);
397 /*******************************************************************
398 samr_reply_enum_dom_groups
399 ********************************************************************/
400 static void samr_reply_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_u,
403 SAMR_R_ENUM_DOM_GROUPS r_e;
404 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES];
407 char *dummy_group = "Domain Admins";
412 /* find the policy handle. open a policy on it. */
413 if (r_e.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
415 r_e.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
418 DEBUG(5,("samr_reply_enum_dom_groups: %d\n", __LINE__));
422 make_unistr2(&(pass[0].uni_user_name), dummy_group, strlen(dummy_group));
423 pass[0].user_rid = DOMAIN_GROUP_RID_ADMINS;
425 if (r_e.status == 0 && got_grps)
427 make_samr_r_enum_dom_groups(&r_e, q_u->start_idx, num_entries, pass, r_e.status);
430 /* store the response in the SMB stream */
431 samr_io_r_enum_dom_groups("", &r_e, rdata, 0);
433 DEBUG(5,("samr_enum_dom_groups: %d\n", __LINE__));
437 /*******************************************************************
438 api_samr_enum_dom_groups
439 ********************************************************************/
440 static void api_samr_enum_dom_groups( uint16 vuid, prs_struct *data, prs_struct *rdata)
442 SAMR_Q_ENUM_DOM_GROUPS q_e;
444 /* grab the samr open */
445 samr_io_q_enum_dom_groups("", &q_e, data, 0);
447 /* construct reply. */
448 samr_reply_enum_dom_groups(&q_e, rdata);
452 /*******************************************************************
453 samr_reply_enum_dom_aliases
454 ********************************************************************/
455 static void samr_reply_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_u,
458 SAMR_R_ENUM_DOM_ALIASES r_e;
459 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES];
468 /* find the policy handle. open a policy on it. */
469 if (r_e.status == 0x0 && !get_lsa_policy_samr_sid(&q_u->pol, &sid))
471 r_e.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
474 sid_to_string(sid_str, &sid);
475 sid_to_string(sam_sid_str, &global_sam_sid);
477 DEBUG(5,("samr_reply_enum_dom_aliases: sid %s\n", sid_str));
479 /* well-known aliases */
480 if (strequal(sid_str, "S-1-5-20"))
483 while (num_entries < MAX_SAM_ENTRIES && ((name = builtin_alias_rids[num_entries].name) != NULL))
485 make_unistr2(&(pass[num_entries].uni_user_name), name, strlen(name));
486 pass[num_entries].user_rid = builtin_alias_rids[num_entries].rid;
490 else if (strequal(sid_str, sam_sid_str))
493 /* oops! there's no code to deal with this */
494 DEBUG(3,("samr_reply_enum_dom_aliases: enum of aliases in our domain not supported yet\n"));
498 make_samr_r_enum_dom_aliases(&r_e, num_entries, pass, r_e.status);
500 /* store the response in the SMB stream */
501 samr_io_r_enum_dom_aliases("", &r_e, rdata, 0);
503 DEBUG(5,("samr_enum_dom_aliases: %d\n", __LINE__));
507 /*******************************************************************
508 api_samr_enum_dom_aliases
509 ********************************************************************/
510 static void api_samr_enum_dom_aliases( uint16 vuid, prs_struct *data, prs_struct *rdata)
512 SAMR_Q_ENUM_DOM_ALIASES q_e;
514 /* grab the samr open */
515 samr_io_q_enum_dom_aliases("", &q_e, data, 0);
517 /* construct reply. */
518 samr_reply_enum_dom_aliases(&q_e, rdata);
522 /*******************************************************************
523 samr_reply_query_dispinfo
524 ********************************************************************/
525 static void samr_reply_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_u,
528 SAMR_R_QUERY_DISPINFO r_e;
532 SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES];
534 int total_entries = 0;
536 uint16 switch_level = 0x0;
542 DEBUG(5,("samr_reply_query_dispinfo: %d\n", __LINE__));
544 /* find the policy handle. open a policy on it. */
545 if (r_e.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
547 r_e.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
548 DEBUG(5,("samr_reply_query_dispinfo: invalid handle\n"));
551 if (r_e.status == 0x0)
554 got_pwds = get_sampwd_entries(pass, q_u->start_idx, &total_entries, &num_entries, MAX_SAM_ENTRIES, 0);
557 switch (q_u->switch_level)
562 /* query disp info is for users */
564 make_sam_info_1(&info1, ACB_NORMAL,
565 q_u->start_idx, num_entries, pass);
567 ctr.sam.info1 = &info1;
573 /* query disp info is for servers */
575 make_sam_info_2(&info2, ACB_WSTRUST,
576 q_u->start_idx, num_entries, pass);
578 ctr.sam.info2 = &info2;
585 if (r_e.status == 0 && got_pwds)
587 make_samr_r_query_dispinfo(&r_e, switch_level, &ctr, r_e.status);
590 /* store the response in the SMB stream */
591 samr_io_r_query_dispinfo("", &r_e, rdata, 0);
593 DEBUG(5,("samr_query_dispinfo: %d\n", __LINE__));
597 /*******************************************************************
598 api_samr_query_dispinfo
599 ********************************************************************/
600 static void api_samr_query_dispinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
602 SAMR_Q_QUERY_DISPINFO q_e;
604 /* grab the samr open */
605 samr_io_q_query_dispinfo("", &q_e, data, 0);
607 /* construct reply. */
608 samr_reply_query_dispinfo(&q_e, rdata);
612 /*******************************************************************
613 samr_reply_query_aliasinfo
614 ********************************************************************/
615 static void samr_reply_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_u,
618 SAMR_R_QUERY_ALIASINFO r_e;
623 /* find the policy handle. open a policy on it. */
624 if (r_e.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
626 r_e.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
629 DEBUG(5,("samr_reply_query_aliasinfo: %d\n", __LINE__));
631 if (r_e.status == 0x0)
633 if (q_u->switch_level != 3)
635 r_e.status = NT_STATUS_INVALID_INFO_CLASS;
639 make_samr_r_query_aliasinfo(&r_e, q_u->switch_level,
640 "<account description>",
643 /* store the response in the SMB stream */
644 samr_io_r_query_aliasinfo("", &r_e, rdata, 0);
646 DEBUG(5,("samr_query_aliasinfo: %d\n", __LINE__));
650 /*******************************************************************
651 api_samr_query_aliasinfo
652 ********************************************************************/
653 static void api_samr_query_aliasinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
655 SAMR_Q_QUERY_ALIASINFO q_e;
657 /* grab the samr open */
658 samr_io_q_query_aliasinfo("", &q_e, data, 0);
660 /* construct reply. */
661 samr_reply_query_aliasinfo(&q_e, rdata);
665 /*******************************************************************
666 samr_reply_lookup_ids
667 ********************************************************************/
668 static void samr_reply_lookup_ids(SAMR_Q_LOOKUP_IDS *q_u,
671 uint32 rid[MAX_SAM_ENTRIES];
673 int num_rids = q_u->num_sids1;
675 SAMR_R_LOOKUP_IDS r_u;
677 DEBUG(5,("samr_lookup_ids: %d\n", __LINE__));
679 if (num_rids > MAX_SAM_ENTRIES)
681 num_rids = MAX_SAM_ENTRIES;
682 DEBUG(5,("samr_lookup_ids: truncating entries to %d\n", num_rids));
687 SMB_ASSERT_ARRAY(q_u->uni_user_name, num_rids);
689 for (i = 0; i < num_rids && status == 0; i++)
691 struct sam_passwd *sam_pass;
695 fstrcpy(user_name, unistrn2(q_u->uni_user_name[i].buffer,
696 q_u->uni_user_name[i].uni_str_len));
698 /* find the user account */
700 sam_pass = get_smb21pwd_entry(user_name, 0);
703 if (sam_pass == NULL)
705 status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
710 rid[i] = sam_pass->user_rid;
716 rid[0] = BUILTIN_ALIAS_RID_USERS;
718 make_samr_r_lookup_ids(&r_u, num_rids, rid, status);
720 /* store the response in the SMB stream */
721 samr_io_r_lookup_ids("", &r_u, rdata, 0);
723 DEBUG(5,("samr_lookup_ids: %d\n", __LINE__));
727 /*******************************************************************
729 ********************************************************************/
730 static void api_samr_lookup_ids( uint16 vuid, prs_struct *data, prs_struct *rdata)
732 SAMR_Q_LOOKUP_IDS q_u;
734 /* grab the samr 0x10 */
735 samr_io_q_lookup_ids("", &q_u, data, 0);
737 /* construct reply. always indicate success */
738 samr_reply_lookup_ids(&q_u, rdata);
741 /*******************************************************************
742 samr_reply_lookup_names
743 ********************************************************************/
744 static void samr_reply_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u,
747 uint32 rid[MAX_SAM_ENTRIES];
750 int num_rids = q_u->num_rids1;
752 SAMR_R_LOOKUP_NAMES r_u;
754 DEBUG(5,("samr_lookup_names: %d\n", __LINE__));
756 if (num_rids > MAX_SAM_ENTRIES)
758 num_rids = MAX_SAM_ENTRIES;
759 DEBUG(5,("samr_lookup_names: truncating entries to %d\n", num_rids));
762 SMB_ASSERT_ARRAY(q_u->uni_user_name, num_rids);
764 for (i = 0; i < num_rids && status == 0; i++)
768 status = 0xC0000000 | NT_STATUS_NONE_MAPPED;
770 fstrcpy(name, unistrn2(q_u->uni_user_name[i].buffer, q_u->uni_user_name[i].uni_str_len));
772 status = (status != 0x0) ? lookup_user_rid (name, &(rid[i])) : status;
773 status = (status != 0x0) ? lookup_group_rid(name, &(rid[i])) : status;
774 status = (status != 0x0) ? lookup_alias_rid(name, &(rid[i])) : status;
777 make_samr_r_lookup_names(&r_u, num_rids, rid, status);
779 /* store the response in the SMB stream */
780 samr_io_r_lookup_names("", &r_u, rdata, 0);
782 DEBUG(5,("samr_lookup_names: %d\n", __LINE__));
786 /*******************************************************************
787 api_samr_lookup_names
788 ********************************************************************/
789 static void api_samr_lookup_names( uint16 vuid, prs_struct *data, prs_struct *rdata)
791 SAMR_Q_LOOKUP_NAMES q_u;
793 /* grab the samr lookup names */
794 samr_io_q_lookup_names("", &q_u, data, 0);
796 /* construct reply. always indicate success */
797 samr_reply_lookup_names(&q_u, rdata);
800 /*******************************************************************
801 samr_reply_chgpasswd_user
802 ********************************************************************/
803 static void samr_reply_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u,
806 SAMR_R_CHGPASSWD_USER r_u;
811 fstrcpy(user_name, unistrn2(q_u->uni_user_name.buffer, q_u->uni_user_name.uni_str_len));
812 fstrcpy(wks , unistrn2(q_u->uni_dest_host.buffer, q_u->uni_dest_host.uni_str_len));
814 DEBUG(5,("samr_chgpasswd_user: user: %s wks: %s\n", user_name, wks));
816 if (!pass_oem_change(user_name,
817 q_u->lm_newpass.pass, q_u->lm_oldhash.hash,
818 q_u->nt_newpass.pass, q_u->nt_oldhash.hash))
820 status = 0xC0000000 | NT_STATUS_WRONG_PASSWORD;
823 make_samr_r_chgpasswd_user(&r_u, status);
825 /* store the response in the SMB stream */
826 samr_io_r_chgpasswd_user("", &r_u, rdata, 0);
828 DEBUG(5,("samr_chgpasswd_user: %d\n", __LINE__));
831 /*******************************************************************
832 api_samr_chgpasswd_user
833 ********************************************************************/
834 static void api_samr_chgpasswd_user( uint16 vuid, prs_struct *data, prs_struct *rdata)
836 SAMR_Q_CHGPASSWD_USER q_u;
838 /* unknown 38 command */
839 samr_io_q_chgpasswd_user("", &q_u, data, 0);
841 /* construct reply. */
842 samr_reply_chgpasswd_user(&q_u, rdata);
846 /*******************************************************************
847 samr_reply_unknown_38
848 ********************************************************************/
849 static void samr_reply_unknown_38(SAMR_Q_UNKNOWN_38 *q_u,
852 SAMR_R_UNKNOWN_38 r_u;
854 DEBUG(5,("samr_unknown_38: %d\n", __LINE__));
856 make_samr_r_unknown_38(&r_u);
858 /* store the response in the SMB stream */
859 samr_io_r_unknown_38("", &r_u, rdata, 0);
861 DEBUG(5,("samr_unknown_38: %d\n", __LINE__));
864 /*******************************************************************
866 ********************************************************************/
867 static void api_samr_unknown_38( uint16 vuid, prs_struct *data, prs_struct *rdata)
869 SAMR_Q_UNKNOWN_38 q_u;
871 /* unknown 38 command */
872 samr_io_q_unknown_38("", &q_u, data, 0);
874 /* construct reply. always indicate success */
875 samr_reply_unknown_38(&q_u, rdata);
879 /*******************************************************************
880 samr_reply_unknown_12
881 ********************************************************************/
882 static void samr_reply_unknown_12(SAMR_Q_UNKNOWN_12 *q_u,
885 fstring group_names[MAX_SAM_ENTRIES];
886 uint32 group_attrs[MAX_SAM_ENTRIES];
888 int num_gids = q_u->num_gids1;
890 SAMR_R_UNKNOWN_12 r_u;
892 DEBUG(5,("samr_unknown_12: %d\n", __LINE__));
894 /* find the policy handle. open a policy on it. */
895 if (status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
897 status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
903 if (num_gids > MAX_SAM_ENTRIES)
905 num_gids = MAX_SAM_ENTRIES;
906 DEBUG(5,("samr_unknown_12: truncating entries to %d\n", num_gids));
909 for (i = 0; i < num_gids && status == 0; i++)
911 fstrcpy(group_names[i], "dummy group");
912 group_attrs[i] = 0x2;
916 make_samr_r_unknown_12(&r_u, num_gids, group_names, group_attrs, status);
918 /* store the response in the SMB stream */
919 samr_io_r_unknown_12("", &r_u, rdata, 0);
921 DEBUG(5,("samr_unknown_12: %d\n", __LINE__));
925 /*******************************************************************
927 ********************************************************************/
928 static void api_samr_unknown_12( uint16 vuid, prs_struct *data, prs_struct *rdata)
930 SAMR_Q_UNKNOWN_12 q_u;
932 /* grab the samr lookup names */
933 samr_io_q_unknown_12("", &q_u, data, 0);
935 /* construct reply. always indicate success */
936 samr_reply_unknown_12(&q_u, rdata);
940 /*******************************************************************
942 ********************************************************************/
943 static void samr_reply_open_user(SAMR_Q_OPEN_USER *q_u,
947 SAMR_R_OPEN_USER r_u;
948 struct sam_passwd *sam_pass;
949 BOOL pol_open = False;
951 /* set up the SAMR open_user response */
952 bzero(r_u.user_pol.data, POL_HND_SIZE);
956 /* find the policy handle. open a policy on it. */
957 if (r_u.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->domain_pol)) == -1))
959 r_u.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
962 /* get a (unique) handle. open a policy on it. */
963 if (r_u.status == 0x0 && !(pol_open = open_lsa_policy_hnd(&(r_u.user_pol))))
965 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
969 sam_pass = getsam21pwrid(q_u->user_rid);
972 /* check that the RID exists in our domain. */
973 if (r_u.status == 0x0 && sam_pass == NULL)
975 r_u.status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
978 /* associate the RID with the (unique) handle. */
979 if (r_u.status == 0x0 && !set_lsa_policy_samr_rid(&(r_u.user_pol), q_u->user_rid))
981 /* oh, whoops. don't know what error message to return, here */
982 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
985 if (r_u.status != 0 && pol_open)
987 close_lsa_policy_hnd(&(r_u.user_pol));
990 DEBUG(5,("samr_open_user: %d\n", __LINE__));
992 /* store the response in the SMB stream */
993 samr_io_r_open_user("", &r_u, rdata, 0);
995 DEBUG(5,("samr_open_user: %d\n", __LINE__));
999 /*******************************************************************
1001 ********************************************************************/
1002 static void api_samr_open_user( uint16 vuid, prs_struct *data, prs_struct *rdata)
1004 SAMR_Q_OPEN_USER q_u;
1006 /* grab the samr unknown 22 */
1007 samr_io_q_open_user("", &q_u, data, 0);
1009 /* construct reply. always indicate success */
1010 samr_reply_open_user(&q_u, rdata, 0x0);
1014 /*************************************************************************
1016 *************************************************************************/
1017 static BOOL get_user_info_10(SAM_USER_INFO_10 *id10, uint32 user_rid)
1019 struct smb_passwd *smb_pass;
1021 if (!pdb_rid_is_user(user_rid))
1023 DEBUG(4,("RID 0x%x is not a user RID\n", user_rid));
1028 smb_pass = getsmbpwrid(user_rid);
1029 unbecome_root(True);
1031 if (smb_pass == NULL)
1033 DEBUG(4,("User 0x%x not found\n", user_rid));
1037 DEBUG(3,("User:[%s]\n", smb_pass->smb_name));
1039 make_sam_user_info10(id10, smb_pass->acct_ctrl);
1044 /*************************************************************************
1046 *************************************************************************/
1047 static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 user_rid)
1050 struct sam_passwd *sam_pass;
1054 if (!pdb_rid_is_user(user_rid))
1056 DEBUG(4,("RID 0x%x is not a user RID\n", user_rid));
1061 sam_pass = getsam21pwrid(user_rid);
1062 unbecome_root(True);
1064 if (sam_pass == NULL)
1066 DEBUG(4,("User 0x%x not found\n", user_rid));
1070 DEBUG(3,("User:[%s]\n", sam_pass->smb_name));
1072 dummy_time.low = 0xffffffff;
1073 dummy_time.high = 0x7fffffff;
1075 DEBUG(0,("get_user_info_21 - TODO: convert unix times to NTTIMEs\n"));
1077 /* create a LOGON_HRS structure */
1078 hrs.len = sam_pass->hours_len;
1079 SMB_ASSERT_ARRAY(hrs.hours, hrs.len);
1080 for (i = 0; i < hrs.len; i++)
1082 hrs.hours[i] = sam_pass->hours[i];
1085 make_sam_user_info21(id21,
1087 &dummy_time, /* logon_time */
1088 &dummy_time, /* logoff_time */
1089 &dummy_time, /* kickoff_time */
1090 &dummy_time, /* pass_last_set_time */
1091 &dummy_time, /* pass_can_change_time */
1092 &dummy_time, /* pass_must_change_time */
1094 sam_pass->smb_name, /* user_name */
1095 sam_pass->full_name, /* full_name */
1096 sam_pass->home_dir, /* home_dir */
1097 sam_pass->dir_drive, /* dir_drive */
1098 sam_pass->logon_script, /* logon_script */
1099 sam_pass->profile_path, /* profile_path */
1100 sam_pass->acct_desc, /* description */
1101 sam_pass->workstations, /* workstations user can log in from */
1102 sam_pass->unknown_str, /* don't know, yet */
1103 sam_pass->munged_dial, /* dialin info. contains dialin path and tel no */
1105 sam_pass->user_rid, /* RID user_id */
1106 sam_pass->group_rid, /* RID group_id */
1107 sam_pass->acct_ctrl,
1109 sam_pass->unknown_3, /* unknown_3 */
1110 sam_pass->logon_divs, /* divisions per week */
1111 &hrs, /* logon hours */
1112 sam_pass->unknown_5,
1113 sam_pass->unknown_6);
1118 /*******************************************************************
1119 samr_reply_query_userinfo
1120 ********************************************************************/
1121 static void samr_reply_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u,
1124 SAMR_R_QUERY_USERINFO r_u;
1126 SAM_USER_INFO_11 id11;
1128 SAM_USER_INFO_10 id10;
1129 SAM_USER_INFO_21 id21;
1132 uint32 status = 0x0;
1135 DEBUG(5,("samr_reply_query_userinfo: %d\n", __LINE__));
1137 /* search for the handle */
1138 if (status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
1140 status = NT_STATUS_INVALID_HANDLE;
1143 /* find the user's rid */
1144 if (status == 0x0 && (rid = get_lsa_policy_samr_rid(&(q_u->pol))) == 0xffffffff)
1146 status = NT_STATUS_OBJECT_TYPE_MISMATCH;
1149 DEBUG(5,("samr_reply_query_userinfo: rid:0x%x\n", rid));
1151 /* ok! user info levels (there are lots: see MSDEV help), off we go... */
1154 switch (q_u->switch_value)
1158 info = (void*)&id10;
1159 status = get_user_info_10(&id10, rid) ? 0 : NT_STATUS_NO_SUCH_USER;
1163 /* whoops - got this wrong. i think. or don't understand what's happening. */
1167 info = (void*)&id11;
1169 expire.low = 0xffffffff;
1170 expire.high = 0x7fffffff;
1172 make_sam_user_info11(&id11, &expire, "BROOKFIELDS$", 0x03ef, 0x201, 0x0080);
1179 info = (void*)&id21;
1180 status = get_user_info_21(&id21, rid) ? 0 : NT_STATUS_NO_SUCH_USER;
1186 status = NT_STATUS_INVALID_INFO_CLASS;
1193 make_samr_r_query_userinfo(&r_u, q_u->switch_value, info, status);
1195 /* store the response in the SMB stream */
1196 samr_io_r_query_userinfo("", &r_u, rdata, 0);
1198 DEBUG(5,("samr_reply_query_userinfo: %d\n", __LINE__));
1202 /*******************************************************************
1203 api_samr_query_userinfo
1204 ********************************************************************/
1205 static void api_samr_query_userinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
1207 SAMR_Q_QUERY_USERINFO q_u;
1209 /* grab the samr unknown 24 */
1210 samr_io_q_query_userinfo("", &q_u, data, 0);
1212 /* construct reply. always indicate success */
1213 samr_reply_query_userinfo(&q_u, rdata);
1217 /*******************************************************************
1218 samr_reply_query_usergroups
1219 ********************************************************************/
1220 static void samr_reply_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u,
1223 SAMR_R_QUERY_USERGROUPS r_u;
1224 uint32 status = 0x0;
1226 struct sam_passwd *sam_pass;
1227 DOM_GID *gids = NULL;
1231 DEBUG(5,("samr_query_usergroups: %d\n", __LINE__));
1233 /* find the policy handle. open a policy on it. */
1234 if (status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->pol)) == -1))
1236 status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
1239 /* find the user's rid */
1240 if (status == 0x0 && (rid = get_lsa_policy_samr_rid(&(q_u->pol))) == 0xffffffff)
1242 status = NT_STATUS_OBJECT_TYPE_MISMATCH;
1248 sam_pass = getsam21pwrid(rid);
1249 unbecome_root(True);
1251 if (sam_pass == NULL)
1253 status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
1260 get_domain_user_groups(groups, sam_pass->smb_name);
1262 num_groups = make_dom_gids(groups, &gids);
1265 /* construct the response. lkclXXXX: gids are not copied! */
1266 make_samr_r_query_usergroups(&r_u, num_groups, gids, status);
1268 /* store the response in the SMB stream */
1269 samr_io_r_query_usergroups("", &r_u, rdata, 0);
1276 DEBUG(5,("samr_query_usergroups: %d\n", __LINE__));
1280 /*******************************************************************
1281 api_samr_query_usergroups
1282 ********************************************************************/
1283 static void api_samr_query_usergroups( uint16 vuid, prs_struct *data, prs_struct *rdata)
1285 SAMR_Q_QUERY_USERGROUPS q_u;
1286 /* grab the samr unknown 32 */
1287 samr_io_q_query_usergroups("", &q_u, data, 0);
1289 /* construct reply. */
1290 samr_reply_query_usergroups(&q_u, rdata);
1294 /*******************************************************************
1295 samr_reply_query_dom_info
1296 ********************************************************************/
1297 static void samr_reply_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u,
1300 SAMR_R_QUERY_DOMAIN_INFO r_u;
1302 uint16 switch_value = 0x0;
1303 uint32 status = 0x0;
1310 DEBUG(5,("samr_reply_query_dom_info: %d\n", __LINE__));
1312 /* find the policy handle. open a policy on it. */
1313 if (r_u.status == 0x0 && (find_lsa_policy_by_hnd(&(q_u->domain_pol)) == -1))
1315 r_u.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
1316 DEBUG(5,("samr_reply_query_dom_info: invalid handle\n"));
1321 switch (q_u->switch_value)
1326 make_unk_info2(&ctr.info.inf2, global_myworkgroup, global_myname);
1332 status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS;
1338 make_samr_r_query_dom_info(&r_u, switch_value, &ctr, status);
1340 /* store the response in the SMB stream */
1341 samr_io_r_query_dom_info("", &r_u, rdata, 0);
1343 DEBUG(5,("samr_query_dom_info: %d\n", __LINE__));
1347 /*******************************************************************
1348 api_samr_query_dom_info
1349 ********************************************************************/
1350 static void api_samr_query_dom_info( uint16 vuid, prs_struct *data, prs_struct *rdata)
1352 SAMR_Q_QUERY_DOMAIN_INFO q_e;
1354 /* grab the samr unknown 8 command */
1355 samr_io_q_query_dom_info("", &q_e, data, 0);
1357 /* construct reply. */
1358 samr_reply_query_dom_info(&q_e, rdata);
1363 /*******************************************************************
1364 samr_reply_unknown_32
1365 ********************************************************************/
1366 static void samr_reply_unknown_32(SAMR_Q_UNKNOWN_32 *q_u,
1371 SAMR_R_UNKNOWN_32 r_u;
1373 /* set up the SAMR unknown_32 response */
1374 bzero(r_u.pol.data, POL_HND_SIZE);
1377 for (i = 4; i < POL_HND_SIZE; i++)
1379 r_u.pol.data[i] = i+1;
1383 make_dom_rid4(&(r_u.rid4), 0x0030, 0, 0);
1384 r_u.status = status;
1386 DEBUG(5,("samr_unknown_32: %d\n", __LINE__));
1388 /* store the response in the SMB stream */
1389 samr_io_r_unknown_32("", &r_u, rdata, 0);
1391 DEBUG(5,("samr_unknown_32: %d\n", __LINE__));
1395 /*******************************************************************
1397 ********************************************************************/
1398 static void api_samr_unknown_32( uint16 vuid, prs_struct *data, prs_struct *rdata)
1401 struct sam_passwd *sam_pass;
1404 SAMR_Q_UNKNOWN_32 q_u;
1406 /* grab the samr unknown 32 */
1407 samr_io_q_unknown_32("", &q_u, data, 0);
1409 /* find the machine account: tell the caller if it exists.
1410 lkclXXXX i have *no* idea if this is a problem or not
1411 or even if you are supposed to construct a different
1412 reply if the account already exists...
1415 fstrcpy(mach_acct, unistrn2(q_u.uni_mach_acct.buffer,
1416 q_u.uni_mach_acct.uni_str_len));
1419 sam_pass = getsam21pwnam(mach_acct);
1420 unbecome_root(True);
1422 if (sam_pass != NULL)
1424 /* machine account exists: say so */
1425 status = 0xC0000000 | NT_STATUS_USER_EXISTS;
1429 /* this could cause trouble... */
1430 DEBUG(0,("trouble!\n"));
1434 /* construct reply. */
1435 samr_reply_unknown_32(&q_u, rdata, status);
1439 /*******************************************************************
1440 samr_reply_connect_anon
1441 ********************************************************************/
1442 static void samr_reply_connect_anon(SAMR_Q_CONNECT_ANON *q_u,
1445 SAMR_R_CONNECT_ANON r_u;
1446 BOOL pol_open = False;
1448 /* set up the SAMR connect_anon response */
1451 /* get a (unique) handle. open a policy on it. */
1452 if (r_u.status == 0x0 && !(pol_open = open_lsa_policy_hnd(&(r_u.connect_pol))))
1454 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
1457 /* associate the domain SID with the (unique) handle. */
1458 if (r_u.status == 0x0 && !set_lsa_policy_samr_pol_status(&(r_u.connect_pol), q_u->unknown_0))
1460 /* oh, whoops. don't know what error message to return, here */
1461 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
1464 if (r_u.status != 0 && pol_open)
1466 close_lsa_policy_hnd(&(r_u.connect_pol));
1469 DEBUG(5,("samr_connect_anon: %d\n", __LINE__));
1471 /* store the response in the SMB stream */
1472 samr_io_r_connect_anon("", &r_u, rdata, 0);
1474 DEBUG(5,("samr_connect_anon: %d\n", __LINE__));
1478 /*******************************************************************
1479 api_samr_connect_anon
1480 ********************************************************************/
1481 static void api_samr_connect_anon( uint16 vuid, prs_struct *data, prs_struct *rdata)
1483 SAMR_Q_CONNECT_ANON q_u;
1485 /* grab the samr open policy */
1486 samr_io_q_connect_anon("", &q_u, data, 0);
1488 /* construct reply. always indicate success */
1489 samr_reply_connect_anon(&q_u, rdata);
1492 /*******************************************************************
1494 ********************************************************************/
1495 static void samr_reply_connect(SAMR_Q_CONNECT *q_u,
1499 BOOL pol_open = False;
1501 /* set up the SAMR connect response */
1504 /* get a (unique) handle. open a policy on it. */
1505 if (r_u.status == 0x0 && !(pol_open = open_lsa_policy_hnd(&(r_u.connect_pol))))
1507 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
1510 /* associate the domain SID with the (unique) handle. */
1511 if (r_u.status == 0x0 && !set_lsa_policy_samr_pol_status(&(r_u.connect_pol), q_u->unknown_0))
1513 /* oh, whoops. don't know what error message to return, here */
1514 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
1517 if (r_u.status != 0 && pol_open)
1519 close_lsa_policy_hnd(&(r_u.connect_pol));
1522 DEBUG(5,("samr_connect: %d\n", __LINE__));
1524 /* store the response in the SMB stream */
1525 samr_io_r_connect("", &r_u, rdata, 0);
1527 DEBUG(5,("samr_connect: %d\n", __LINE__));
1531 /*******************************************************************
1533 ********************************************************************/
1534 static void api_samr_connect( uint16 vuid, prs_struct *data, prs_struct *rdata)
1538 /* grab the samr open policy */
1539 samr_io_q_connect("", &q_u, data, 0);
1541 /* construct reply. always indicate success */
1542 samr_reply_connect(&q_u, rdata);
1545 /*******************************************************************
1546 samr_reply_open_alias
1547 ********************************************************************/
1548 static void samr_reply_open_alias(SAMR_Q_OPEN_ALIAS *q_u,
1551 SAMR_R_OPEN_ALIAS r_u;
1552 BOOL pol_open = False;
1554 /* set up the SAMR open_alias response */
1557 /* get a (unique) handle. open a policy on it. */
1558 if (r_u.status == 0x0 && !(pol_open = open_lsa_policy_hnd(&(r_u.pol))))
1560 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
1563 /* associate a RID with the (unique) handle. */
1564 if (r_u.status == 0x0 && !set_lsa_policy_samr_rid(&(r_u.pol), q_u->rid_alias))
1566 /* oh, whoops. don't know what error message to return, here */
1567 r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
1570 if (r_u.status != 0 && pol_open)
1572 close_lsa_policy_hnd(&(r_u.pol));
1575 DEBUG(5,("samr_open_alias: %d\n", __LINE__));
1577 /* store the response in the SMB stream */
1578 samr_io_r_open_alias("", &r_u, rdata, 0);
1580 DEBUG(5,("samr_open_alias: %d\n", __LINE__));
1584 /*******************************************************************
1586 ********************************************************************/
1587 static void api_samr_open_alias( uint16 vuid, prs_struct *data, prs_struct *rdata)
1590 SAMR_Q_OPEN_ALIAS q_u;
1592 /* grab the samr open policy */
1593 samr_io_q_open_alias("", &q_u, data, 0);
1595 /* construct reply. always indicate success */
1596 samr_reply_open_alias(&q_u, rdata);
1599 /*******************************************************************
1600 array of \PIPE\samr operations
1601 ********************************************************************/
1602 static struct api_struct api_samr_cmds [] =
1604 { "SAMR_CLOSE_HND" , SAMR_CLOSE_HND , api_samr_close_hnd },
1605 { "SAMR_CONNECT" , SAMR_CONNECT , api_samr_connect },
1606 { "SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON , api_samr_connect_anon },
1607 { "SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS , api_samr_enum_dom_users },
1608 { "SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS , api_samr_enum_dom_groups },
1609 { "SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES , api_samr_enum_dom_aliases },
1610 { "SAMR_LOOKUP_IDS" , SAMR_LOOKUP_IDS , api_samr_lookup_ids },
1611 { "SAMR_LOOKUP_NAMES" , SAMR_LOOKUP_NAMES , api_samr_lookup_names },
1612 { "SAMR_OPEN_USER" , SAMR_OPEN_USER , api_samr_open_user },
1613 { "SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO , api_samr_query_userinfo },
1614 { "SAMR_QUERY_DOMAIN_INFO", SAMR_QUERY_DOMAIN_INFO, api_samr_query_dom_info },
1615 { "SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS , api_samr_query_usergroups },
1616 { "SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO , api_samr_query_dispinfo },
1617 { "SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO , api_samr_query_aliasinfo },
1618 { "SAMR_0x32" , 0x32 , api_samr_unknown_32 },
1619 { "SAMR_UNKNOWN_12" , SAMR_UNKNOWN_12 , api_samr_unknown_12 },
1620 { "SAMR_UNKNOWN_38" , SAMR_UNKNOWN_38 , api_samr_unknown_38 },
1621 { "SAMR_CHGPASSWD_USER" , SAMR_CHGPASSWD_USER , api_samr_chgpasswd_user },
1622 { "SAMR_OPEN_ALIAS" , SAMR_OPEN_ALIAS , api_samr_open_alias },
1623 { "SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN , api_samr_open_domain },
1624 { "SAMR_UNKNOWN_3" , SAMR_UNKNOWN_3 , api_samr_unknown_3 },
1625 { "SAMR_UNKNOWN_2C" , SAMR_UNKNOWN_2C , api_samr_unknown_2c },
1629 /*******************************************************************
1630 receives a samr pipe and responds.
1631 ********************************************************************/
1632 BOOL api_samr_rpc(pipes_struct *p, prs_struct *data)
1634 return api_rpcTNP(p, "api_samr_rpc", api_samr_cmds, data);