description' to name the repository.
summaryrefslogtreecommitdiffstats
path: root/src/lib/kadm5/adb.h
blob: 66eadfc3b6ee93c0b9ec5e92dc066db847a274ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
 * Data Types for policy and principal information that
 * exists in the respective databases.
 *
 * $Header$
 *
 * This file was originally created with rpcgen.
 * It has been hacked up since then.
 */

#ifndef __ADB_H__
#define __ADB_H__
#include <sys/types.h>
#include <gssrpc/types.h>
#include "k5-int.h"
#include <kdb.h>
#include <db.h>
#include <kadm5/admin.h>
#include <kadm5/adb_err.h>
#include <com_err.h>

typedef	long		osa_adb_ret_t;

#define OSA_ADB_POLICY_DB_MAGIC	0x12345A00
#define OSA_ADB_PRINC_DB_MAGIC	0x12345B00

#define OSA_ADB_SHARED		0x7001
#define OSA_ADB_EXCLUSIVE	0x7002
#define OSA_ADB_PERMANENT	0x7003

#define OSA_ADB_PRINC_VERSION_MASK	0x12345C00
#define OSA_ADB_PRINC_VERSION_1		0x12345C01
#define OSA_ADB_POLICY_VERSION_MASK	0x12345D00
#define OSA_ADB_POLICY_VERSION_1	0x12345D01

typedef struct _osa_adb_db_lock_ent_t {
     FILE	*lockfile;
     char	*filename;
     int	refcnt, lockmode, lockcnt;
     krb5_context context;
} osa_adb_lock_ent, *osa_adb_lock_t;

typedef struct _osa_adb_db_ent_t {
     int	magic;
     DB		*db;
     HASHINFO	info;
     BTREEINFO	btinfo;
     char	*filename;
     osa_adb_lock_t lock;
     int	opencnt;
} osa_adb_db_ent, *osa_adb_db_t, *osa_adb_princ_t, *osa_adb_policy_t;

/* an osa_pw_hist_ent stores all the key_datas for a single password */
typedef struct _osa_pw_hist_t {
     int n_key_data;
     krb5_key_data *key_data;
} osa_pw_hist_ent, *osa_pw_hist_t;

typedef struct _osa_princ_ent_t {
    int				version;
    char			*policy;
    long			aux_attributes;
    unsigned int		old_key_len;
    unsigned int		old_key_next;
    krb5_kvno			admin_history_kvno;
    osa_pw_hist_ent		*old_keys;
} osa_princ_ent_rec, *osa_princ_ent_t;

typedef struct _osa_policy_ent_t {