the beginnings of a new scheme I've working on to allow an easier
[nivanova/samba-autobuild/.git] / source3 / rpcclient / cmd_samr.c
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    NT Domain Authentication SMB / MSRPC client
5    Copyright (C) Andrew Tridgell 1994-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23
24
25 #ifdef SYSLOG
26 #undef SYSLOG
27 #endif
28
29 #include "includes.h"
30
31 extern int DEBUGLEVEL;
32
33 #define DEBUG_TESTING
34
35 extern struct cli_state *smb_cli;
36
37 extern FILE* out_hnd;
38
39
40 /****************************************************************************
41 SAM password change
42 ****************************************************************************/
43 void cmd_sam_ntchange_pwd(struct client_info *info)
44 {
45         fstring srv_name;
46         fstring domain;
47         fstring sid;
48         char *new_passwd;
49         BOOL res = True;
50         char nt_newpass[516];
51         uchar nt_hshhash[16];
52         uchar nt_newhash[16];
53         uchar nt_oldhash[16];
54         char lm_newpass[516];
55         uchar lm_newhash[16];
56         uchar lm_hshhash[16];
57         uchar lm_oldhash[16];
58
59         sid_to_string(sid, &info->dom.level5_sid);
60         fstrcpy(domain, info->dom.level5_dom);
61
62         fstrcpy(srv_name, "\\\\");
63         fstrcat(srv_name, info->dest_host);
64         strupper(srv_name);
65
66         fprintf(out_hnd, "SAM NT Password Change\n");
67
68 #if 0
69         struct pwd_info new_pwd;
70         pwd_read(&new_pwd, "New Password (ONCE: this is test code!):", True);
71 #endif
72         new_passwd = (char*)getpass("New Password (ONCE ONLY - get it right :-)");
73
74         nt_lm_owf_gen(new_passwd, lm_newhash, nt_newhash);
75         pwd_get_lm_nt_16(&(smb_cli->pwd), lm_oldhash, nt_oldhash );
76         make_oem_passwd_hash(nt_newpass, new_passwd, nt_oldhash, True);
77         make_oem_passwd_hash(lm_newpass, new_passwd, lm_oldhash, True);
78         E_old_pw_hash(lm_newhash, lm_oldhash, lm_hshhash);
79         E_old_pw_hash(lm_newhash, nt_oldhash, nt_hshhash);
80
81         cli_nt_set_ntlmssp_flgs(smb_cli,
82                                     NTLMSSP_NEGOTIATE_UNICODE |
83                                     NTLMSSP_NEGOTIATE_OEM |
84                                     NTLMSSP_NEGOTIATE_SIGN |
85                                     NTLMSSP_NEGOTIATE_SEAL |
86                                     NTLMSSP_NEGOTIATE_LM_KEY |
87                                     NTLMSSP_NEGOTIATE_NTLM |
88                                     NTLMSSP_NEGOTIATE_ALWAYS_SIGN |
89                                     NTLMSSP_NEGOTIATE_00001000 |
90                                     NTLMSSP_NEGOTIATE_00002000);
91
92         /* open SAMR session.  */
93         res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
94
95         /* establish a connection. */
96         res = res ? do_samr_get_dom_pwinfo(smb_cli, srv_name) : False;
97
98         /* establish a connection. */
99         res = res ? do_samr_chgpasswd_user(smb_cli,
100                                            srv_name, smb_cli->user_name,
101                                            nt_newpass, nt_hshhash,
102                                            lm_newpass, lm_hshhash) : False;
103         /* close the session */
104         cli_nt_session_close(smb_cli);
105
106         if (res)
107         {
108                 fprintf(out_hnd, "NT Password changed OK\n");
109         }
110         else
111         {
112                 fprintf(out_hnd, "NT Password change FAILED\n");
113         }
114 }
115
116
117 /****************************************************************************
118 experimental SAM encryted rpc test connection
119 ****************************************************************************/
120 void cmd_sam_test(struct client_info *info)
121 {
122         fstring srv_name;
123         fstring domain;
124         fstring sid;
125         BOOL res = True;
126
127         sid_to_string(sid, &info->dom.level5_sid);
128         fstrcpy(domain, info->dom.level5_dom);
129
130 /*
131         if (strlen(sid) == 0)
132         {
133                 fprintf(out_hnd, "please use 'lsaquery' first, to ascertain the SID\n");
134                 return;
135         }
136 */
137         fstrcpy(srv_name, "\\\\");
138         fstrcat(srv_name, info->dest_host);
139         strupper(srv_name);
140
141         fprintf(out_hnd, "SAM Encryption Test\n");
142
143         cli_nt_set_ntlmssp_flgs(smb_cli,
144                                     NTLMSSP_NEGOTIATE_UNICODE |
145                                     NTLMSSP_NEGOTIATE_OEM |
146                                     NTLMSSP_NEGOTIATE_SIGN |
147                                     NTLMSSP_NEGOTIATE_SEAL |
148                                     NTLMSSP_NEGOTIATE_LM_KEY |
149                                     NTLMSSP_NEGOTIATE_NTLM |
150                                     NTLMSSP_NEGOTIATE_ALWAYS_SIGN |
151                                     NTLMSSP_NEGOTIATE_00001000 |
152                                     NTLMSSP_NEGOTIATE_00002000);
153
154         /* open SAMR session.  */
155         res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
156
157         /* establish a connection. */
158         res = res ? do_samr_get_dom_pwinfo(smb_cli, srv_name) : False;
159
160         /* close the session */
161         cli_nt_session_close(smb_cli);
162
163         if (res)
164         {
165                 DEBUG(5,("cmd_sam_test: succeeded\n"));
166         }
167         else
168         {
169                 DEBUG(5,("cmd_sam_test: failed\n"));
170         }
171 }
172
173
174 /****************************************************************************
175 experimental SAM users enum.
176 ****************************************************************************/
177 void cmd_sam_enum_users(struct client_info *info)
178 {
179         fstring srv_name;
180         fstring domain;
181         fstring sid;
182         DOM_SID sid1;
183         int user_idx;
184         BOOL res = True;
185         BOOL request_user_info  = False;
186         BOOL request_group_info = False;
187         uint16 num_entries = 0;
188         uint16 unk_0 = 0x0;
189         uint16 acb_mask = 0;
190         uint16 unk_1 = 0x0;
191         uint32 admin_rid = 0x304; /* absolutely no idea. */
192         fstring tmp;
193
194         sid_to_string(sid, &info->dom.level5_sid);
195         fstrcpy(domain, info->dom.level5_dom);
196
197         if (strlen(sid) == 0)
198         {
199                 fprintf(out_hnd, "please use 'lsaquery' first, to ascertain the SID\n");
200                 return;
201         }
202
203         init_dom_sid(&sid1, sid);
204
205         fstrcpy(srv_name, "\\\\");
206         fstrcat(srv_name, info->dest_host);
207         strupper(srv_name);
208
209         /* a bad way to do token parsing... */
210         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
211         {
212                 request_user_info  |= strequal(tmp, "-u");
213                 request_group_info |= strequal(tmp, "-g");
214         }
215
216         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
217         {
218                 request_user_info  |= strequal(tmp, "-u");
219                 request_group_info |= strequal(tmp, "-g");
220         }
221
222 #ifdef DEBUG_TESTING
223         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
224         {
225                 num_entries = (uint16)strtol(tmp, (char**)NULL, 16);
226         }
227
228         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
229         {
230                 unk_0 = (uint16)strtol(tmp, (char**)NULL, 16);
231         }
232
233         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
234         {
235                 acb_mask = (uint16)strtol(tmp, (char**)NULL, 16);
236         }
237
238         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
239         {
240                 unk_1 = (uint16)strtol(tmp, (char**)NULL, 16);
241         }
242 #endif
243
244         fprintf(out_hnd, "SAM Enumerate Users\n");
245         fprintf(out_hnd, "From: %s To: %s Domain: %s SID: %s\n",
246                           info->myhostname, srv_name, domain, sid);
247
248 #ifdef DEBUG_TESTING
249         DEBUG(5,("Number of entries:%d unk_0:%04x acb_mask:%04x unk_1:%04x\n",
250                   num_entries, unk_0, acb_mask, unk_1));
251 #endif
252
253         /* open SAMR session.  negotiate credentials */
254         res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
255
256         /* establish a connection. */
257         res = res ? do_samr_connect(smb_cli, 
258                                 srv_name, 0x00000020,
259                                 &info->dom.samr_pol_connect) : False;
260
261         /* connect to the domain */
262         res = res ? do_samr_open_domain(smb_cli, 
263                     &info->dom.samr_pol_connect, admin_rid, &sid1,
264                     &info->dom.samr_pol_open_domain) : False;
265
266         /* read some users */
267         res = res ? do_samr_enum_dom_users(smb_cli, 
268                                 &info->dom.samr_pol_open_domain,
269                     num_entries, unk_0, acb_mask, unk_1, 0xffff,
270                                 &info->dom.sam, &info->dom.num_sam_entries) : False;
271
272         if (res && info->dom.num_sam_entries == 0)
273         {
274                 fprintf(out_hnd, "No users\n");
275         }
276
277         if (request_user_info || request_group_info)
278         {
279                 /* query all the users */
280                 user_idx = 0;
281
282                 while (res && user_idx < info->dom.num_sam_entries)
283                 {
284                         uint32 user_rid = info->dom.sam[user_idx].smb_userid;
285                         SAM_USER_INFO_21 usr;
286
287                         fprintf(out_hnd, "User RID: %8x  User Name: %s\n",
288                                           user_rid,
289                                           info->dom.sam[user_idx].acct_name);
290
291                         if (request_user_info)
292                         {
293                                 /* send user info query, level 0x15 */
294                                 if (get_samr_query_userinfo(smb_cli,
295                                                         &info->dom.samr_pol_open_domain,
296                                                         0x15, user_rid, &usr))
297                                 {
298                                         display_sam_user_info_21(out_hnd, ACTION_HEADER   , &usr);
299                                         display_sam_user_info_21(out_hnd, ACTION_ENUMERATE, &usr);
300                                         display_sam_user_info_21(out_hnd, ACTION_FOOTER   , &usr);
301                                 }
302                         }
303
304                         if (request_group_info)
305                         {
306                                 uint32 num_groups;
307                                 DOM_GID gid[LSA_MAX_GROUPS];
308
309                                 /* send user group query */
310                                 if (get_samr_query_usergroups(smb_cli,
311                                                         &info->dom.samr_pol_open_domain,
312                                                         user_rid, &num_groups, gid))
313                                 {
314                                         display_group_rid_info(out_hnd, ACTION_HEADER   , num_groups, gid);
315                                         display_group_rid_info(out_hnd, ACTION_ENUMERATE, num_groups, gid);
316                                         display_group_rid_info(out_hnd, ACTION_FOOTER   , num_groups, gid);
317                                 }
318                         }
319
320                         user_idx++;
321                 }
322         }
323
324         res = res ? do_samr_close(smb_cli,
325                     &info->dom.samr_pol_open_domain) : False;
326
327         res = res ? do_samr_close(smb_cli,
328                     &info->dom.samr_pol_connect) : False;
329
330         /* close the session */
331         cli_nt_session_close(smb_cli);
332
333         if (info->dom.sam != NULL)
334         {
335                 free(info->dom.sam);
336         }
337
338         if (res)
339         {
340                 DEBUG(5,("cmd_sam_enum_users: succeeded\n"));
341         }
342         else
343         {
344                 DEBUG(5,("cmd_sam_enum_users: failed\n"));
345         }
346 }
347
348
349 /****************************************************************************
350 experimental SAM user query.
351 ****************************************************************************/
352 void cmd_sam_query_user(struct client_info *info)
353 {
354         fstring srv_name;
355         fstring domain;
356         fstring sid;
357         DOM_SID sid1;
358         int user_idx = 0;  /* FIXME maybe ... */
359         BOOL res = True;
360         uint32 admin_rid = 0x304; /* absolutely no idea. */
361         fstring rid_str ;
362         fstring info_str;
363         uint32 user_rid = 0;
364         uint32 info_level = 0x15;
365
366         SAM_USER_INFO_21 usr;
367
368         sid_to_string(sid, &info->dom.level5_sid);
369         fstrcpy(domain, info->dom.level5_dom);
370
371         if (strlen(sid) == 0)
372         {
373                 fprintf(out_hnd, "please use 'lsaquery' first, to ascertain the SID\n");
374                 return;
375         }
376
377         init_dom_sid(&sid1, sid);
378
379         fstrcpy(srv_name, "\\\\");
380         fstrcat(srv_name, info->dest_host);
381         strupper(srv_name);
382
383         if (next_token(NULL, rid_str , NULL, sizeof(rid_str )) &&
384             next_token(NULL, info_str, NULL, sizeof(info_str)))
385         {
386                 user_rid   = (uint32)strtol(rid_str , (char**)NULL, 16);
387                 info_level = (uint32)strtol(info_str, (char**)NULL, 10);
388         }
389
390         fprintf(out_hnd, "SAM Query User: rid %x info level %d\n",
391                           user_rid, info_level);
392         fprintf(out_hnd, "From: %s To: %s Domain: %s SID: %s\n",
393                           info->myhostname, srv_name, domain, sid);
394
395         /* open SAMR session.  negotiate credentials */
396         res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
397
398         /* establish a connection. */
399         res = res ? do_samr_connect(smb_cli,
400                                 srv_name, 0x00000020,
401                                 &info->dom.samr_pol_connect) : False;
402
403         /* connect to the domain */
404         res = res ? do_samr_open_domain(smb_cli,
405                     &info->dom.samr_pol_connect, admin_rid, &sid1,
406                     &info->dom.samr_pol_open_domain) : False;
407
408         fprintf(out_hnd, "User RID: %8x  User Name: %s\n",
409                           user_rid,
410                           info->dom.sam[user_idx].acct_name);
411
412         /* send user info query, level */
413         if (get_samr_query_userinfo(smb_cli,
414                                         &info->dom.samr_pol_open_domain,
415                                         info_level, user_rid, &usr))
416         {
417                 if (info_level == 0x15)
418                 {
419                         display_sam_user_info_21(out_hnd, ACTION_HEADER   , &usr);
420                         display_sam_user_info_21(out_hnd, ACTION_ENUMERATE, &usr);
421                         display_sam_user_info_21(out_hnd, ACTION_FOOTER   , &usr);
422                 }
423         }
424
425         res = res ? do_samr_close(smb_cli,
426                     &info->dom.samr_pol_connect) : False;
427
428         res = res ? do_samr_close(smb_cli,
429                     &info->dom.samr_pol_open_domain) : False;
430
431         /* close the session */
432         cli_nt_session_close(smb_cli);
433
434         if (res)
435         {
436                 DEBUG(5,("cmd_sam_query_user: succeeded\n"));
437         }
438         else
439         {
440                 DEBUG(5,("cmd_sam_query_user: failed\n"));
441         }
442 }
443
444
445 /****************************************************************************
446 experimental SAM groups query.
447 ****************************************************************************/
448 void cmd_sam_query_groups(struct client_info *info)
449 {
450         fstring srv_name;
451         fstring domain;
452         fstring sid;
453         DOM_SID sid1;
454         BOOL res = True;
455         fstring info_str;
456         uint32 switch_value = 2;
457         uint32 admin_rid = 0x304; /* absolutely no idea. */
458
459         sid_to_string(sid, &info->dom.level5_sid);
460         fstrcpy(domain, info->dom.level5_dom);
461
462         if (strlen(sid) == 0)
463         {
464                 fprintf(out_hnd, "please use 'lsaquery' first, to ascertain the SID\n");
465                 return;
466         }
467
468         init_dom_sid(&sid1, sid);
469
470         fstrcpy(srv_name, "\\\\");
471         fstrcat(srv_name, info->dest_host);
472         strupper(srv_name);
473
474         if (next_token(NULL, info_str, NULL, sizeof(info_str)))
475         {
476                 switch_value = (uint32)strtol(info_str, (char**)NULL, 10);
477         }
478
479         fprintf(out_hnd, "SAM Query Groups: info level %d\n", switch_value);
480         fprintf(out_hnd, "From: %s To: %s Domain: %s SID: %s\n",
481                           info->myhostname, srv_name, domain, sid);
482
483         /* open SAMR session.  negotiate credentials */
484         res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
485
486         /* establish a connection. */
487         res = res ? do_samr_connect(smb_cli, 
488                                 srv_name, 0x00000020,
489                                 &info->dom.samr_pol_connect) : False;
490
491         /* connect to the domain */
492         res = res ? do_samr_open_domain(smb_cli, 
493                     &info->dom.samr_pol_connect, admin_rid, &sid1,
494                     &info->dom.samr_pol_open_domain) : False;
495
496         /* send a samr 0x8 command */
497         res = res ? do_samr_query_dom_info(smb_cli,
498                     &info->dom.samr_pol_open_domain, switch_value) : False;
499
500         res = res ? do_samr_close(smb_cli,
501                     &info->dom.samr_pol_connect) : False;
502
503         res = res ? do_samr_close(smb_cli, 
504                     &info->dom.samr_pol_open_domain) : False;
505
506         /* close the session */
507         cli_nt_session_close(smb_cli);
508
509         if (res)
510         {
511                 DEBUG(5,("cmd_sam_query_groups: succeeded\n"));
512         }
513         else
514         {
515                 DEBUG(5,("cmd_sam_query_groups: failed\n"));
516         }
517 }
518
519
520 /****************************************************************************
521 experimental SAM aliases query.
522 ****************************************************************************/
523 void cmd_sam_enum_aliases(struct client_info *info)
524 {
525         fstring srv_name;
526         fstring domain;
527         fstring sid;
528         DOM_SID sid1;
529         BOOL res = True;
530         BOOL request_user_info  = False;
531         BOOL request_alias_info = False;
532         uint32 admin_rid = 0x304; /* absolutely no idea. */
533         fstring tmp;
534
535         uint32 num_aliases = 3;
536         uint32 alias_rid[3] = { DOMAIN_GROUP_RID_ADMINS, DOMAIN_GROUP_RID_USERS, DOMAIN_GROUP_RID_GUESTS };
537         fstring alias_names [3];
538         uint32  num_als_usrs[3];
539
540         sid_to_string(sid, &info->dom.level3_sid);
541         fstrcpy(domain, info->dom.level3_dom);
542 #if 0
543         fstrcpy(sid   , "S-1-5-20");
544 #endif
545         if (strlen(sid) == 0)
546         {
547                 fprintf(out_hnd, "please use 'lsaquery' first, to ascertain the SID\n");
548                 return;
549         }
550
551         init_dom_sid(&sid1, sid);
552
553         fstrcpy(srv_name, "\\\\");
554         fstrcat(srv_name, info->dest_host);
555         strupper(srv_name);
556
557         /* a bad way to do token parsing... */
558         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
559         {
560                 request_user_info  |= strequal(tmp, "-u");
561                 request_alias_info |= strequal(tmp, "-g");
562         }
563
564         if (next_token(NULL, tmp, NULL, sizeof(tmp)))
565         {
566                 request_user_info  |= strequal(tmp, "-u");
567                 request_alias_info |= strequal(tmp, "-g");
568         }
569
570         fprintf(out_hnd, "SAM Enumerate Aliases\n");
571         fprintf(out_hnd, "From: %s To: %s Domain: %s SID: %s\n",
572                           info->myhostname, srv_name, domain, sid);
573
574         /* open SAMR session.  negotiate credentials */
575         res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
576
577         /* establish a connection. */
578         res = res ? do_samr_connect(smb_cli,
579                                 srv_name, 0x00000020,
580                                 &info->dom.samr_pol_connect) : False;
581
582         /* connect to the domain */
583         res = res ? do_samr_open_domain(smb_cli,
584                     &info->dom.samr_pol_connect, admin_rid, &sid1,
585                     &info->dom.samr_pol_open_domain) : False;
586
587         /* send a query on the aliase */
588         res = res ? do_samr_query_lookup_rids(smb_cli,
589                     &info->dom.samr_pol_open_domain, admin_rid, num_aliases, alias_rid,
590                     &num_aliases, alias_names, num_als_usrs) : False;
591
592         if (res)
593         {
594                 display_alias_name_info(out_hnd, ACTION_HEADER   , num_aliases, alias_names, num_als_usrs);
595                 display_alias_name_info(out_hnd, ACTION_ENUMERATE, num_aliases, alias_names, num_als_usrs);
596                 display_alias_name_info(out_hnd, ACTION_FOOTER   , num_aliases, alias_names, num_als_usrs);
597         }
598
599 #if 0
600
601         /* read some users */
602         res = res ? do_samr_enum_dom_users(smb_cli,
603                                 &info->dom.samr_pol_open_domain,
604                     num_entries, unk_0, acb_mask, unk_1, 0xffff,
605                                 info->dom.sam, &info->dom.num_sam_entries) : False;
606
607         if (res && info->dom.num_sam_entries == 0)
608         {
609                 fprintf(out_hnd, "No users\n");
610         }
611
612         if (request_user_info || request_alias_info)
613         {
614                 /* query all the users */
615                 user_idx = 0;
616
617                 while (res && user_idx < info->dom.num_sam_entries)
618                 {
619                         uint32 user_rid = info->dom.sam[user_idx].smb_userid;
620                         SAM_USER_INFO_21 usr;
621
622                         fprintf(out_hnd, "User RID: %8x  User Name: %s\n",
623                                           user_rid,
624                                           info->dom.sam[user_idx].acct_name);
625
626                         if (request_user_info)
627                         {
628                                 /* send user info query, level 0x15 */
629                                 if (get_samr_query_userinfo(smb_cli,
630                                                         &info->dom.samr_pol_open_domain,
631                                                         0x15, user_rid, &usr))
632                                 {
633                                         display_sam_user_info_21(out_hnd, ACTION_HEADER   , &usr);
634                                         display_sam_user_info_21(out_hnd, ACTION_ENUMERATE, &usr);
635                                         display_sam_user_info_21(out_hnd, ACTION_FOOTER   , &usr);
636                                 }
637                         }
638
639                         if (request_alias_info)
640                         {
641                                 uint32 num_aliases;
642                                 DOM_GID gid[LSA_MAX_GROUPS];
643
644                                 /* send user aliase query */
645                                 if (get_samr_query_useraliases(smb_cli, 
646                                                         &info->dom.samr_pol_open_domain,
647                                                         user_rid, &num_aliases, gid))
648                                 {
649                                         display_alias_info(out_hnd, ACTION_HEADER   , num_aliases, gid);
650                                         display_alias_info(out_hnd, ACTION_ENUMERATE, num_aliases, gid);
651                                         display_alias_info(out_hnd, ACTION_FOOTER   , num_aliases, gid);
652                                 }
653                         }
654
655                         user_idx++;
656                 }
657         }
658 #endif
659
660         res = res ? do_samr_close(smb_cli, 
661                     &info->dom.samr_pol_connect) : False;
662
663         res = res ? do_samr_close(smb_cli,
664                     &info->dom.samr_pol_open_domain) : False;
665
666         /* close the session */
667         cli_nt_session_close(smb_cli);
668
669         if (res)
670         {
671                 DEBUG(5,("cmd_sam_enum_users: succeeded\n"));
672         }
673         else
674         {
675                 DEBUG(5,("cmd_sam_enum_users: failed\n"));
676         }
677 }
678
679