First round of merging various UUID structures.
[jerry/samba.git] / source / rpcclient / cmd_lsarpc.c
1 /*
2    Unix SMB/CIFS implementation.
3    RPC pipe client
4
5    Copyright (C) Tim Potter              2000
6    Copyright (C) Rafal Szczesniak        2002
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 #include "includes.h"
24 #include "rpcclient.h"
25
26
27 /* useful function to allow entering a name instead of a SID and
28  * looking it up automatically */
29 static NTSTATUS name_to_sid(struct cli_state *cli, 
30                             TALLOC_CTX *mem_ctx,
31                             DOM_SID *sid, const char *name)
32 {
33         POLICY_HND pol;
34         uint32 *sid_types;
35         NTSTATUS result;
36         DOM_SID *sids;
37
38         /* maybe its a raw SID */
39         if (strncmp(name, "S-", 2) == 0 &&
40             string_to_sid(sid, name)) {
41                 return NT_STATUS_OK;
42         }
43
44         result = cli_lsa_open_policy(cli, mem_ctx, True, 
45                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
46                                      &pol);
47         if (!NT_STATUS_IS_OK(result))
48                 goto done;
49
50         result = cli_lsa_lookup_names(cli, mem_ctx, &pol, 1, &name, &sids, &sid_types);
51         if (!NT_STATUS_IS_OK(result))
52                 goto done;
53
54         cli_lsa_close(cli, mem_ctx, &pol);
55
56         *sid = sids[0];
57
58 done:
59         return result;
60 }
61
62
63 /* Look up domain related information on a remote host */
64
65 static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli, 
66                                           TALLOC_CTX *mem_ctx, int argc, 
67                                           const char **argv) 
68 {
69         POLICY_HND pol;
70         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
71         DOM_SID dom_sid;
72         UUID_FLAT dom_guid;
73         fstring sid_str, domain_name="", dns_name="", forest_name="";
74         uint32 info_class = 3;
75
76         if (argc > 2) {
77                 printf("Usage: %s [info_class]\n", argv[0]);
78                 return NT_STATUS_OK;
79         }
80
81         if (argc == 2)
82                 info_class = atoi(argv[1]);
83         
84         /* Lookup info policy */
85         switch (info_class) {
86         case 12:
87                 result = cli_lsa_open_policy2(cli, mem_ctx, True, 
88                                              SEC_RIGHTS_MAXIMUM_ALLOWED,
89                                              &pol);
90
91                 if (!NT_STATUS_IS_OK(result))
92                         goto done;
93                 result = cli_lsa_query_info_policy2(cli, mem_ctx, &pol,
94                                                     info_class, domain_name,
95                                                     dns_name, forest_name,
96                                                     &dom_guid, &dom_sid);
97                 break;
98         default:
99                 result = cli_lsa_open_policy(cli, mem_ctx, True, 
100                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
101                                      &pol);
102
103                 if (!NT_STATUS_IS_OK(result))
104                         goto done;
105                 result = cli_lsa_query_info_policy(cli, mem_ctx, &pol, 
106                                                    info_class, domain_name, 
107                                                    &dom_sid);
108         }
109
110         if (!NT_STATUS_IS_OK(result))
111                 goto done;
112
113         sid_to_string(sid_str, &dom_sid);
114
115         if (domain_name[0])
116                 printf("domain %s has sid %s\n", domain_name, sid_str);
117         else
118                 printf("could not query info for level %d\n", info_class);
119
120         if (dns_name[0])
121                 printf("domain dns name is %s\n", dns_name);
122         if (forest_name[0])
123                 printf("forest name is %s\n", forest_name);
124
125         if (info_class == 12) {
126                 printf("domain GUID is %s\n",
127                        smb_uuid_string_static(
128                                smb_uuid_unpack_static(dom_guid)));
129         }
130  done:
131         return result;
132 }
133
134 /* Resolve a list of names to a list of sids */
135
136 static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli, 
137                                      TALLOC_CTX *mem_ctx, int argc, 
138                                      const char **argv)
139 {
140         POLICY_HND pol;
141         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
142         DOM_SID *sids;
143         uint32 *types;
144         int i;
145
146         if (argc == 1) {
147                 printf("Usage: %s [name1 [name2 [...]]]\n", argv[0]);
148                 return NT_STATUS_OK;
149         }
150
151         result = cli_lsa_open_policy(cli, mem_ctx, True, 
152                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
153                                      &pol);
154
155         if (!NT_STATUS_IS_OK(result))
156                 goto done;
157
158         result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1, 
159                                       (const char**)(argv + 1), &sids, &types);
160
161         if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) != 
162             NT_STATUS_V(STATUS_SOME_UNMAPPED))
163                 goto done;
164
165         result = NT_STATUS_OK;
166
167         /* Print results */
168
169         for (i = 0; i < (argc - 1); i++) {
170                 fstring sid_str;
171                 sid_to_string(sid_str, &sids[i]);
172                 printf("%s %s (%s: %d)\n", argv[i + 1], sid_str,
173                        sid_type_lookup(types[i]), types[i]);
174         }
175
176  done:
177         return result;
178 }
179
180 /* Resolve a list of SIDs to a list of names */
181
182 static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
183                                     int argc, const char **argv)
184 {
185         POLICY_HND pol;
186         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
187         DOM_SID *sids;
188         char **domains;
189         char **names;
190         uint32 *types;
191         int i;
192
193         if (argc == 1) {
194                 printf("Usage: %s [sid1 [sid2 [...]]]\n", argv[0]);
195                 return NT_STATUS_OK;
196         }
197
198         result = cli_lsa_open_policy(cli, mem_ctx, True, 
199                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
200                                      &pol);
201
202         if (!NT_STATUS_IS_OK(result))
203                 goto done;
204
205         /* Convert arguments to sids */
206
207         sids = (DOM_SID *)talloc(mem_ctx, sizeof(DOM_SID) * (argc - 1));
208
209         if (!sids) {
210                 printf("could not allocate memory for %d sids\n", argc - 1);
211                 goto done;
212         }
213
214         for (i = 0; i < argc - 1; i++) 
215                 if (!string_to_sid(&sids[i], argv[i + 1])) {
216                         result = NT_STATUS_INVALID_SID;
217                         goto done;
218                 }
219
220         /* Lookup the SIDs */
221
222         result = cli_lsa_lookup_sids(cli, mem_ctx, &pol, argc - 1, sids, 
223                                      &domains, &names, &types);
224
225         if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) != 
226             NT_STATUS_V(STATUS_SOME_UNMAPPED))
227                 goto done;
228
229         result = NT_STATUS_OK;
230
231         /* Print results */
232
233         for (i = 0; i < (argc - 1); i++) {
234                 fstring sid_str;
235
236                 sid_to_string(sid_str, &sids[i]);
237                 printf("%s %s\\%s (%d)\n", sid_str, 
238                        domains[i] ? domains[i] : "*unknown*", 
239                        names[i] ? names[i] : "*unknown*", types[i]);
240         }
241
242  done:
243         return result;
244 }
245
246 /* Enumerate list of trusted domains */
247
248 static NTSTATUS cmd_lsa_enum_trust_dom(struct cli_state *cli, 
249                                        TALLOC_CTX *mem_ctx, int argc, 
250                                        const char **argv)
251 {
252         POLICY_HND pol;
253         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
254         DOM_SID *domain_sids;
255         char **domain_names;
256
257         /* defaults, but may be changed using params */
258         uint32 enum_ctx = 0;
259         uint32 num_domains = 0;
260         int i;
261
262         if (argc > 2) {
263                 printf("Usage: %s [enum context (0)]\n", argv[0]);
264                 return NT_STATUS_OK;
265         }
266
267         if (argc == 2 && argv[1]) {
268                 enum_ctx = atoi(argv[2]);
269         }       
270
271         result = cli_lsa_open_policy(cli, mem_ctx, True, 
272                                      POLICY_VIEW_LOCAL_INFORMATION,
273                                      &pol);
274
275         if (!NT_STATUS_IS_OK(result))
276                 goto done;
277
278         /* Lookup list of trusted domains */
279
280         result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx,
281                                         &num_domains,
282                                         &domain_names, &domain_sids);
283         if (!NT_STATUS_IS_OK(result) &&
284             !NT_STATUS_EQUAL(result, NT_STATUS_NO_MORE_ENTRIES) &&
285             !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES))
286             goto done;
287
288         /* Print results: list of names and sids returned in this response. */   
289         for (i = 0; i < num_domains; i++) {
290                 fstring sid_str;
291
292                 sid_to_string(sid_str, &domain_sids[i]);
293                 printf("%s %s\n", domain_names[i] ? domain_names[i] : 
294                        "*unknown*", sid_str);
295         }
296
297  done:
298         return result;
299 }
300
301 /* Enumerates privileges */
302
303 static NTSTATUS cmd_lsa_enum_privilege(struct cli_state *cli, 
304                                        TALLOC_CTX *mem_ctx, int argc, 
305                                        const char **argv) 
306 {
307         POLICY_HND pol;
308         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
309
310         uint32 enum_context=0;
311         uint32 pref_max_length=0x1000;
312         uint32 count=0;
313         char   **privs_name;
314         uint32 *privs_high;
315         uint32 *privs_low;
316         int i;
317
318         if (argc > 3) {
319                 printf("Usage: %s [enum context] [max length]\n", argv[0]);
320                 return NT_STATUS_OK;
321         }
322
323         if (argc>=2)
324                 enum_context=atoi(argv[1]);
325
326         if (argc==3)
327                 pref_max_length=atoi(argv[2]);
328
329         result = cli_lsa_open_policy(cli, mem_ctx, True, 
330                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
331                                      &pol);
332
333         if (!NT_STATUS_IS_OK(result))
334                 goto done;
335
336         result = cli_lsa_enum_privilege(cli, mem_ctx, &pol, &enum_context, pref_max_length,
337                                         &count, &privs_name, &privs_high, &privs_low);
338
339         if (!NT_STATUS_IS_OK(result))
340                 goto done;
341
342         /* Print results */
343         printf("found %d privileges\n\n", count);
344
345         for (i = 0; i < count; i++) {
346                 printf("%s \t\t%d:%d (0x%x:0x%x)\n", privs_name[i] ? privs_name[i] : "*unknown*",
347                        privs_high[i], privs_low[i], privs_high[i], privs_low[i]);
348         }
349
350  done:
351         return result;
352 }
353
354 /* Get privilege name */
355
356 static NTSTATUS cmd_lsa_get_dispname(struct cli_state *cli, 
357                                      TALLOC_CTX *mem_ctx, int argc, 
358                                      const char **argv) 
359 {
360         POLICY_HND pol;
361         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
362
363         uint16 lang_id=0;
364         uint16 lang_id_sys=0;
365         uint16 lang_id_desc;
366         fstring description;
367
368         if (argc != 2) {
369                 printf("Usage: %s privilege name\n", argv[0]);
370                 return NT_STATUS_OK;
371         }
372
373         result = cli_lsa_open_policy(cli, mem_ctx, True, 
374                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
375                                      &pol);
376
377         if (!NT_STATUS_IS_OK(result))
378                 goto done;
379
380         result = cli_lsa_get_dispname(cli, mem_ctx, &pol, argv[1], lang_id, lang_id_sys, description, &lang_id_desc);
381
382         if (!NT_STATUS_IS_OK(result))
383                 goto done;
384
385         /* Print results */
386         printf("%s -> %s (language: 0x%x)\n", argv[1], description, lang_id_desc);
387
388  done:
389         return result;
390 }
391
392 /* Enumerate the LSA SIDS */
393
394 static NTSTATUS cmd_lsa_enum_sids(struct cli_state *cli, 
395                                   TALLOC_CTX *mem_ctx, int argc, 
396                                   const char **argv) 
397 {
398         POLICY_HND pol;
399         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
400
401         uint32 enum_context=0;
402         uint32 pref_max_length=0x1000;
403         DOM_SID *sids;
404         uint32 count=0;
405         int i;
406
407         if (argc > 3) {
408                 printf("Usage: %s [enum context] [max length]\n", argv[0]);
409                 return NT_STATUS_OK;
410         }
411
412         if (argc>=2)
413                 enum_context=atoi(argv[1]);
414
415         if (argc==3)
416                 pref_max_length=atoi(argv[2]);
417
418         result = cli_lsa_open_policy(cli, mem_ctx, True, 
419                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
420                                      &pol);
421
422         if (!NT_STATUS_IS_OK(result))
423                 goto done;
424
425         result = cli_lsa_enum_sids(cli, mem_ctx, &pol, &enum_context, pref_max_length,
426                                         &count, &sids);
427
428         if (!NT_STATUS_IS_OK(result))
429                 goto done;
430
431         /* Print results */
432         printf("found %d SIDs\n\n", count);
433
434         for (i = 0; i < count; i++) {
435                 fstring sid_str;
436
437                 sid_to_string(sid_str, &sids[i]);
438                 printf("%s\n", sid_str);
439         }
440
441  done:
442         return result;
443 }
444
445 /* Enumerate the privileges of an SID */
446
447 static NTSTATUS cmd_lsa_enum_privsaccounts(struct cli_state *cli, 
448                                            TALLOC_CTX *mem_ctx, int argc, 
449                                            const char **argv) 
450 {
451         POLICY_HND dom_pol;
452         POLICY_HND user_pol;
453         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
454         uint32 access_desired = 0x000f000f;
455         
456         DOM_SID sid;
457         uint32 count=0;
458         LUID_ATTR *set;
459         int i;
460
461         if (argc != 2 ) {
462                 printf("Usage: %s SID\n", argv[0]);
463                 return NT_STATUS_OK;
464         }
465
466         result = name_to_sid(cli, mem_ctx, &sid, argv[1]);
467         if (!NT_STATUS_IS_OK(result))
468                 goto done;      
469
470         result = cli_lsa_open_policy2(cli, mem_ctx, True, 
471                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
472                                      &dom_pol);
473
474         if (!NT_STATUS_IS_OK(result))
475                 goto done;
476
477         result = cli_lsa_open_account(cli, mem_ctx, &dom_pol, &sid, access_desired, &user_pol);
478
479         if (!NT_STATUS_IS_OK(result))
480                 goto done;
481
482         result = cli_lsa_enum_privsaccount(cli, mem_ctx, &user_pol, &count, &set);
483
484         if (!NT_STATUS_IS_OK(result))
485                 goto done;
486
487         /* Print results */
488         printf("found %d privileges for SID %s\n\n", count, argv[1]);
489         printf("high\tlow\tattribute\n");
490
491         for (i = 0; i < count; i++) {
492                 printf("%u\t%u\t%u\n", set[i].luid.high, set[i].luid.low, set[i].attr);
493         }
494
495  done:
496         return result;
497 }
498
499
500 /* Enumerate the privileges of an SID via LsaEnumerateAccountRights */
501
502 static NTSTATUS cmd_lsa_enum_acct_rights(struct cli_state *cli, 
503                                          TALLOC_CTX *mem_ctx, int argc, 
504                                          const char **argv) 
505 {
506         POLICY_HND dom_pol;
507         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
508
509         DOM_SID sid;
510         uint32 count;
511         char **rights;
512
513         int i;
514
515         if (argc != 2 ) {
516                 printf("Usage: %s SID\n", argv[0]);
517                 return NT_STATUS_OK;
518         }
519
520         result = name_to_sid(cli, mem_ctx, &sid, argv[1]);
521         if (!NT_STATUS_IS_OK(result))
522                 goto done;      
523
524         result = cli_lsa_open_policy2(cli, mem_ctx, True, 
525                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
526                                      &dom_pol);
527
528         if (!NT_STATUS_IS_OK(result))
529                 goto done;
530
531         result = cli_lsa_enum_account_rights(cli, mem_ctx, &dom_pol, sid, &count, &rights);
532
533         if (!NT_STATUS_IS_OK(result))
534                 goto done;
535
536         printf("found %d privileges for SID %s\n", count, sid_string_static(&sid));
537
538         for (i = 0; i < count; i++) {
539                 printf("\t%s\n", rights[i]);
540         }
541
542  done:
543         return result;
544 }
545
546
547 /* add some privileges to a SID via LsaAddAccountRights */
548
549 static NTSTATUS cmd_lsa_add_acct_rights(struct cli_state *cli, 
550                                         TALLOC_CTX *mem_ctx, int argc, 
551                                         const char **argv) 
552 {
553         POLICY_HND dom_pol;
554         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
555
556         DOM_SID sid;
557
558         if (argc < 3 ) {
559                 printf("Usage: %s SID [rights...]\n", argv[0]);
560                 return NT_STATUS_OK;
561         }
562
563         result = name_to_sid(cli, mem_ctx, &sid, argv[1]);
564         if (!NT_STATUS_IS_OK(result))
565                 goto done;      
566
567         result = cli_lsa_open_policy2(cli, mem_ctx, True, 
568                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
569                                      &dom_pol);
570
571         if (!NT_STATUS_IS_OK(result))
572                 goto done;
573
574         result = cli_lsa_add_account_rights(cli, mem_ctx, &dom_pol, sid, 
575                                             argc-2, argv+2);
576
577         if (!NT_STATUS_IS_OK(result))
578                 goto done;
579
580  done:
581         return result;
582 }
583
584
585 /* remove some privileges to a SID via LsaRemoveAccountRights */
586
587 static NTSTATUS cmd_lsa_remove_acct_rights(struct cli_state *cli, 
588                                         TALLOC_CTX *mem_ctx, int argc, 
589                                         const char **argv) 
590 {
591         POLICY_HND dom_pol;
592         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
593
594         DOM_SID sid;
595
596         if (argc < 3 ) {
597                 printf("Usage: %s SID [rights...]\n", argv[0]);
598                 return NT_STATUS_OK;
599         }
600
601         result = name_to_sid(cli, mem_ctx, &sid, argv[1]);
602         if (!NT_STATUS_IS_OK(result))
603                 goto done;      
604
605         result = cli_lsa_open_policy2(cli, mem_ctx, True, 
606                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
607                                      &dom_pol);
608
609         if (!NT_STATUS_IS_OK(result))
610                 goto done;
611
612         result = cli_lsa_remove_account_rights(cli, mem_ctx, &dom_pol, sid, 
613                                                False, argc-2, argv+2);
614
615         if (!NT_STATUS_IS_OK(result))
616                 goto done;
617
618  done:
619         return result;
620 }
621
622
623 /* Get a privilege value given its name */
624
625 static NTSTATUS cmd_lsa_lookupprivvalue(struct cli_state *cli, 
626                                         TALLOC_CTX *mem_ctx, int argc, 
627                                         const char **argv) 
628 {
629         POLICY_HND pol;
630         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
631         LUID luid;
632
633         if (argc != 2 ) {
634                 printf("Usage: %s name\n", argv[0]);
635                 return NT_STATUS_OK;
636         }
637
638         result = cli_lsa_open_policy2(cli, mem_ctx, True, 
639                                      SEC_RIGHTS_MAXIMUM_ALLOWED,
640                                      &pol);
641
642         if (!NT_STATUS_IS_OK(result))
643                 goto done;
644
645         result = cli_lsa_lookupprivvalue(cli, mem_ctx, &pol, argv[1], &luid);
646
647         if (!NT_STATUS_IS_OK(result))
648                 goto done;
649
650         /* Print results */
651
652         printf("%u:%u (0x%x:0x%x)\n", luid.high, luid.low, luid.high, luid.low);
653
654  done:
655         return result;
656 }
657
658 /* Query LSA security object */
659
660 static NTSTATUS cmd_lsa_query_secobj(struct cli_state *cli, 
661                                      TALLOC_CTX *mem_ctx, int argc, 
662                                      const char **argv) 
663 {
664         POLICY_HND pol;
665         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
666         SEC_DESC_BUF *sdb;
667         uint32 sec_info = 0x00000004; /* ??? */
668
669         if (argc != 1 ) {
670                 printf("Usage: %s\n", argv[0]);
671                 return NT_STATUS_OK;
672         }
673
674         result = cli_lsa_open_policy2(cli, mem_ctx, True, 
675                                       SEC_RIGHTS_MAXIMUM_ALLOWED,
676                                       &pol);
677
678         if (!NT_STATUS_IS_OK(result))
679                 goto done;
680
681         result = cli_lsa_query_secobj(cli, mem_ctx, &pol, sec_info, &sdb);
682
683         if (!NT_STATUS_IS_OK(result))
684                 goto done;
685
686         /* Print results */
687
688         display_sec_desc(sdb->sec);
689
690  done:
691         return result;
692 }
693
694
695 /* List of commands exported by this module */
696
697 struct cmd_set lsarpc_commands[] = {
698
699         { "LSARPC" },
700
701         { "lsaquery",            RPC_RTYPE_NTSTATUS, cmd_lsa_query_info_policy,  NULL, PI_LSARPC, "Query info policy",                    "" },
702         { "lookupsids",          RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_sids,        NULL, PI_LSARPC, "Convert SIDs to names",                "" },
703         { "lookupnames",         RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_names,       NULL, PI_LSARPC, "Convert names to SIDs",                "" },
704         { "enumtrust",           RPC_RTYPE_NTSTATUS, cmd_lsa_enum_trust_dom,     NULL, PI_LSARPC, "Enumerate trusted domains",            "Usage: [preferred max number] [enum context (0)]" },
705         { "enumprivs",           RPC_RTYPE_NTSTATUS, cmd_lsa_enum_privilege,     NULL, PI_LSARPC, "Enumerate privileges",                 "" },
706         { "getdispname",         RPC_RTYPE_NTSTATUS, cmd_lsa_get_dispname,       NULL, PI_LSARPC, "Get the privilege name",               "" },
707         { "lsaenumsid",          RPC_RTYPE_NTSTATUS, cmd_lsa_enum_sids,          NULL, PI_LSARPC, "Enumerate the LSA SIDS",               "" },
708         { "lsaenumprivsaccount", RPC_RTYPE_NTSTATUS, cmd_lsa_enum_privsaccounts, NULL, PI_LSARPC, "Enumerate the privileges of an SID",   "" },
709         { "lsaenumacctrights",   RPC_RTYPE_NTSTATUS, cmd_lsa_enum_acct_rights,   NULL, PI_LSARPC, "Enumerate the rights of an SID",   "" },
710         { "lsaaddacctrights",    RPC_RTYPE_NTSTATUS, cmd_lsa_add_acct_rights,    NULL, PI_LSARPC, "Add rights to an account",   "" },
711         { "lsaremoveacctrights", RPC_RTYPE_NTSTATUS, cmd_lsa_remove_acct_rights, NULL, PI_LSARPC, "Remove rights from an account",   "" },
712         { "lsalookupprivvalue",  RPC_RTYPE_NTSTATUS, cmd_lsa_lookupprivvalue,    NULL, PI_LSARPC, "Get a privilege value given its name", "" },
713         { "lsaquerysecobj",      RPC_RTYPE_NTSTATUS, cmd_lsa_query_secobj,       NULL, PI_LSARPC, "Query LSA security object", "" },
714
715         { NULL }
716 };