dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / krb5 / kadmin / cli / kadmin_rmt.c
blob8fd69e319d6ac135ab0fd3f375c166503399676d
1 /*
2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
7 /*
8 * Contains remote client specific code.
9 */
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <libintl.h>
14 #include <k5-int.h>
15 #include <krb5.h>
17 extern void *handle;
19 void
20 usage(char *whoami)
22 fprintf(stderr,
23 "%s: %s [-r realm] [-p principal] [-q query] "
24 "[-s admin_server[:port]] [[-c ccache]|[-k [-t keytab]]"
25 "|[-w password]]\n",
26 gettext("Usage"), whoami);
27 exit(1);
32 * Debugging function - for remote admin client
34 /* ARGSUSED */
35 void
36 debugEnable(int displayMsgs)
39 #ifdef DEBUG
40 /* Solaris Kerberos: not supported */
41 /* debugDisplaySS(displayMsgs); */
42 #endif
45 void
46 kadmin_getprivs(argc, argv)
47 int argc;
48 char *argv[];
50 static char *privs[] = {"GET", "ADD", "MODIFY", "DELETE", "LIST", "CHANGE"};
51 krb5_error_code retval;
52 int i;
53 long plist;
55 if (argc != 1) {
56 fprintf(stderr, "%s: get_privs\n", gettext("usage"));
57 return;
59 retval = kadm5_get_privs(handle, &plist);
60 if (retval) {
61 com_err("get_privs", retval,
62 gettext("while retrieving privileges"));
63 return;
65 printf(gettext("current privileges:"));
66 for (i = 0; i < sizeof (privs) / sizeof (char *); i++) {
67 if (plist & 1 << i)
68 printf(" %s", gettext(privs[i]));
70 printf("\n");