xref: /titanic_50/usr/src/cmd/krb5/kadmin/cli/kadmin_loc.c (revision 25cf1a301a396c38e8adf52c15f537b80d2483f7)
1 /*
2  * Copyright (c) 1998-1999 by Sun Microsystems, Inc.
3  * All rights reserved.
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 	debugDisplaySS(displayMsgs);
46 #endif
47 
48 }
49 
50 void
51 kadmin_getprivs(argc, argv)
52 int argc;
53 char *argv[];
54 {
55     static char *privs[] = {"GET", "ADD", "MODIFY", "DELETE", "LIST",
56 			    "CHANGEPW"};
57 	krb5_error_code retval;
58 	int i;
59 	long plist;
60 
61 /*  for kadmin.local return all privilages  */
62 
63 	printf(gettext("current privileges:"));
64 	for (i = 0; i < sizeof (privs) / 4; i++) {
65 		printf(" %s", gettext(privs[i]));
66 	}
67 	printf("\n");
68 }
69