xref: /illumos-gate/usr/src/cmd/krb5/kadmin/dbutil/kdb5_util.h (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
1 /*
2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef _KDB5_UTIL_H
7 #define	_KDB5_UTIL_H
8 
9 /*
10  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
11  *
12  *	Openvision retains the copyright to derivative works of
13  *	this source code.  Do *NOT* create a derivative of this
14  *	source code before consulting with your legal department.
15  *	Do *NOT* integrate *ANY* of this source code into another
16  *	product before consulting with your legal department.
17  *
18  *	For further information, read the top-level Openvision
19  *	copyright which is contained in the top-level MIT Kerberos
20  *	copyright.
21  *
22  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
23  *
24  */
25 
26 #ifdef	__cplusplus
27 extern "C" {
28 #endif
29 
30 /*
31  * admin/edit/kdb5_edit.h
32  *
33  * Copyright 1992 by the Massachusetts Institute of Technology.
34  * All Rights Reserved.
35  *
36  * Export of this software from the United States of America may
37  *   require a specific license from the United States Government.
38  *   It is the responsibility of any person or organization contemplating
39  *   export to obtain such a license before exporting.
40  *
41  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
42  * distribute this software and its documentation for any purpose and
43  * without fee is hereby granted, provided that the above copyright
44  * notice appear in all copies and that both that copyright notice and
45  * this permission notice appear in supporting documentation, and that
46  * the name of M.I.T. not be used in advertising or publicity pertaining
47  * to distribution of the software without specific, written prior
48  * permission.  Furthermore if you modify this software you must label
49  * your software as modified software and not distribute it in such a
50  * fashion that it might be confused with the original M.I.T. software.
51  * M.I.T. makes no representations about the suitability of
52  * this software for any purpose.  It is provided "as is" without express
53  * or implied warranty.
54  *
55  */
56 #include <kdb/kdb_log.h>
57 #define MAX_HEADER      1024
58 #define REALM_SEP	'@'
59 #define REALM_SEP_STR	"@"
60 
61 extern char *progname;
62 extern char *Err_no_database;
63 #ifndef V4_DECLARES_STATIC
64 extern krb5_keyblock master_keyblock;
65 extern krb5_principal master_princ;
66 #endif
67 extern krb5_boolean dbactive;
68 extern int exit_status;
69 extern krb5_context util_context;
70 extern kadm5_config_params global_params;
71 extern int valid_master_key;
72 extern krb5_db_entry master_db;
73 extern char **db5util_db_args;
74 extern int    db5util_db_args_size;
75 extern int add_db_arg(char *arg);
76 
77 extern void usage(void);
78 
79 extern void add_key
80 	(char const *, char const *,
81 		   krb5_const_principal, const krb5_keyblock *,
82 		   krb5_kvno, krb5_keysalt *);
83 extern int set_dbname_help
84 	(char *, char *);
85 
86 extern char *kdb5_util_Init (int, char **);
87 
88 extern int quit (void);
89 
90 extern int check_for_match
91 	(char *, int, krb5_db_entry *, int, int);
92 
93 extern void parse_token
94 	(char *, int *, int *, char *);
95 
96 extern int create_db_entry (krb5_principal, krb5_db_entry *);
97 
98 extern int kadm5_create_magic_princs (kadm5_config_params *params,
99 						krb5_context context);
100 
101 extern int process_ov_principal (char *fname, krb5_context kcontext,
102 					   FILE *filep, int verbose,
103 					   int *linenop);
104 
105 extern void load_db (int argc, char **argv);
106 extern void dump_db (int argc, char **argv);
107 extern void kdb5_create (int argc, char **argv);
108 extern void kdb5_destroy (int argc, char **argv);
109 extern void kdb5_stash (int argc, char **argv);
110 
111 extern void update_ok_file (char *file_name);
112 
113 extern int kadm5_create (kadm5_config_params *params);
114 
115 void usage (void);
116 
117 #ifdef	__cplusplus
118 }
119 #endif
120 
121 #endif	/* !_KDB5_UTIL_H */
122