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