xref: /illumos-gate/usr/src/cmd/krb5/kadmin/cli/kadmin_loc.c (revision 2aeafac3612e19716bf8164f89c3c9196342979c)
1 /*
2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 /*
9  * Contains kadmin.local specific code.
10  */
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <libintl.h>
15 #include <db.h>
16 #include <krb5.h>
17 
18 
19 void
20 usage(char *whoami)
21 {
22 	fprintf(stderr,
23 	    "%s: %s [-r realm] [-p principal] [-q query] "
24 	    "[-d dbname] [-e \"enc:salt ...\"] [-m] [-D]\n",
25 	    gettext("Usage"), whoami);
26 	exit(1);
27 }
28 
29 
30 /*
31  * Debugging function
32  * Turns on low level debugging in db module
33  * Requires that db library be compiled with -DDEBUG_DB flag
34  */
35 /* ARGSUSED */
36 void
37 debugEnable(int displayMsgs)
38 {
39 
40 #if DEBUG_DB
41 	debugDisplayDB(displayMsgs);
42 #endif
43 
44 #if DEBUG
45 	/* Solaris Kerberos: not supported */
46 	/* debugDisplaySS(displayMsgs); */
47 #endif
48 
49 }
50 
51 void
52 kadmin_getprivs(argc, argv)
53 int argc;
54 char *argv[];
55 {
56     static char *privs[] = {"GET", "ADD", "MODIFY", "DELETE", "LIST",
57 			    "CHANGEPW"};
58 	krb5_error_code retval;
59 	int i;
60 	long plist;
61 
62 /*  for kadmin.local return all privilages  */
63 
64 	printf(gettext("current privileges:"));
65 	for (i = 0; i < sizeof (privs) / 4; i++) {
66 		printf(" %s", gettext(privs[i]));
67 	}
68 	printf("\n");
69 }
70