(had to be this way because simply having it include server_internal.h
and using the typedef found there causes inclusion in the wrong order).
A pointer to a _kadm5_server_handle_t structure has been added to the
_osa_adb_db_ent_t structure. This was needed for a frustrating and
non-ideal reason, and it's a bit of a kludge. Read the lengthy comment
in the file for an explanation of why this was done. A struct
_kadm5_server_handle_t pointer was added to the prototypes of
osa_adb_init_db and osa_adb_open_policy.
* admin.h: Prototype added for kadm5_get_generation_number.
* admin_xdr.h: Prototypes added for xdr_getgeneration_arg and
xdr_getgeneration_ret.
* kadm_rpc.h: Added struct getgeneration_arg and struct
getgeneration_ret and typedefs for them, defined GET_GENERATION_NUMBER,
added prototypes for getgeneration_4_svc and getgeneration_4.
* kadm_rpc_xdr.c: Added new functions xdr_getgeneration_arg and
xdr_getgeneration_ret.
* server_internal.h: Added prototypes for kdb_put_entry_internal and
kdb_update_generation_number.
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/incremental-propagation-branch@13409
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-06-20 Mitchell Berger <mitchb@mit.edu>
+
+ * adb.h: Forward declaration of struct _kadm5_server_handle_t added
+ (had to be this way because simply having it include server_internal.h
+ and using the typedef found there causes inclusion in the wrong order).
+ A pointer to a _kadm5_server_handle_t structure has been added to the
+ _osa_adb_db_ent_t structure. This was needed for a frustrating and
+ non-ideal reason, and it's a bit of a kludge. Read the lengthy comment
+ in the file for an explanation of why this was done. A struct
+ _kadm5_server_handle_t pointer was added to the prototypes of
+ osa_adb_init_db and osa_adb_open_policy.
+
+ * admin.h: Prototype added for kadm5_get_generation_number.
+
+ * admin_xdr.h: Prototypes added for xdr_getgeneration_arg and
+ xdr_getgeneration_ret.
+
+ * kadm_rpc.h: Added struct getgeneration_arg and struct
+ getgeneration_ret and typedefs for them, defined GET_GENERATION_NUMBER,
+ added prototypes for getgeneration_4_svc and getgeneration_4.
+
+ * kadm_rpc_xdr.c: Added new functions xdr_getgeneration_arg and
+ xdr_getgeneration_ret.
+
+ * server_internal.h: Added prototypes for kdb_put_entry_internal and
+ kdb_update_generation_number.
+
2001-06-18 Ezra Peisach <epeisach@mit.edu>
#define OSA_ADB_POLICY_VERSION_MASK 0x12345D00
#define OSA_ADB_POLICY_VERSION_1 0x12345D01
+/* This structure is really defined in server_internal.h, but that file
+ * includes this file, and if this file includes that file, though they are
+ * protected against multiple inclusion, the definition of this structure
+ * and the structure in this file that uses it happen in the wrong order.
+ */
+struct _kadm5_server_handle_t;
+
typedef struct _osa_adb_db_lock_ent_t {
FILE *lockfile;
char *filename;
BTREEINFO btinfo;
char *filename;
osa_adb_lock_t lock;
+ /* XXX Ewww - The handle to the policy db needs a handle to the principal
+ * db because in order to get generation numbers to increase when policies
+ * get added, changed, or deleted, we need to be able to do a kdb_get_entry
+ * on the master principal, and that call takes a handle. Alternatives
+ * included changing the format of the database (inconvenient to
+ * upgraders), keeping the policy and principal databases in sync
+ * separately (seems wrong since they're dumped together, and really want
+ * to be one database in the future), or reengineering the database
+ * structure right now (seems unreasonable to get done before dinner 8-) ).
+ * --mitchb
+ */
+ struct _kadm5_server_handle_t *kadm5_handle;
} 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 */
osa_adb_ret_t osa_adb_rename_policy_db(kadm5_config_params *fromparams,
kadm5_config_params *toparams);
osa_adb_ret_t osa_adb_init_db(osa_adb_db_t *dbp, char *filename,
- char *lockfile, int magic);
+ char *lockfile, int magic,
+ struct _kadm5_server_handle_t *kadm5_handle);
osa_adb_ret_t osa_adb_fini_db(osa_adb_db_t db, int magic);
osa_adb_ret_t osa_adb_get_lock(osa_adb_db_t db, int mode);
osa_adb_ret_t osa_adb_release_lock(osa_adb_db_t db);
osa_adb_ret_t osa_adb_destroy_policy_db(kadm5_config_params *params);
osa_adb_ret_t osa_adb_open_princ(osa_adb_princ_t *db, char *filename);
osa_adb_ret_t osa_adb_open_policy(osa_adb_policy_t *db,
- kadm5_config_params *rparams);
+ kadm5_config_params *rparams,
+ struct _kadm5_server_handle_t *kadm5_handle);
osa_adb_ret_t osa_adb_close_princ(osa_adb_princ_t db);
osa_adb_ret_t osa_adb_close_policy(osa_adb_policy_t db);
osa_adb_ret_t osa_adb_create_princ(osa_adb_princ_t db,
kadm5_ret_t kadm5_free_name_list(void *server_handle, char **names,
int count);
+#if USE_KADM5_API_VERSION > 1
+kadm5_ret_t kadm5_get_generation_number(void *server_handle,
+ krb5_int32 *generation);
+#endif
+
#if USE_KADM5_API_VERSION == 1
/*
* OVSEC_KADM_API_VERSION_1 should be, if possible, compile-time
* $Header$
*
* $Log$
+ * Revision 1.6.2.1 2001/06/20 08:17:06 mitchb
+ * * adb.h: Forward declaration of struct _kadm5_server_handle_t added
+ * (had to be this way because simply having it include server_internal.h
+ * and using the typedef found there causes inclusion in the wrong order).
+ * A pointer to a _kadm5_server_handle_t structure has been added to the
+ * _osa_adb_db_ent_t structure. This was needed for a frustrating and
+ * non-ideal reason, and it's a bit of a kludge. Read the lengthy comment
+ * in the file for an explanation of why this was done. A struct
+ * _kadm5_server_handle_t pointer was added to the prototypes of
+ * osa_adb_init_db and osa_adb_open_policy.
+ *
+ * * admin.h: Prototype added for kadm5_get_generation_number.
+ *
+ * * admin_xdr.h: Prototypes added for xdr_getgeneration_arg and
+ * xdr_getgeneration_ret.
+ *
+ * * kadm_rpc.h: Added struct getgeneration_arg and struct
+ * getgeneration_ret and typedefs for them, defined GET_GENERATION_NUMBER,
+ * added prototypes for getgeneration_4_svc and getgeneration_4.
+ *
+ * * kadm_rpc_xdr.c: Added new functions xdr_getgeneration_arg and
+ * xdr_getgeneration_ret.
+ *
+ * * server_internal.h: Added prototypes for kdb_put_entry_internal and
+ * kdb_update_generation_number.
+ *
* Revision 1.6 2001/02/18 23:00:08 epeisach
+ *
* * server_internal.h: Add prototype for
* krb5_free_key_data_contents() which really should be in libkdb.
*
bool_t xdr_gpols_arg(XDR *xdrs, gpols_arg *objp);
bool_t xdr_gpols_ret(XDR *xdrs, gpols_ret *objp);
bool_t xdr_getprivs_ret(XDR *xdrs, getprivs_ret *objp);
+bool_t xdr_getgeneration_arg(XDR *xdrs, getgeneration_arg *objp);
+bool_t xdr_getgeneration_ret(XDR *xdrs, getgeneration_ret *objp);
bool_t xdr_krb5_principal(XDR *xdrs, krb5_principal *objp);
bool_t xdr_krb5_octet(XDR *xdrs, krb5_octet *objp);
bool_t xdr_krb5_int32(XDR *xdrs, krb5_int32 *objp);
typedef struct getprivs_ret getprivs_ret;
bool_t xdr_getprivs_ret();
+struct getgeneration_arg {
+ krb5_ui_4 api_version;
+};
+typedef struct getgeneration_arg getgeneration_arg;
+bool_t xdr_getgeneration_arg();
+
+struct getgeneration_ret {
+ krb5_ui_4 api_version;
+ kadm5_ret_t code;
+ krb5_int32 generation;
+};
+typedef struct getgeneration_ret getgeneration_ret;
+bool_t xdr_getgeneration_ret();
+
#define KADM ((krb5_ui_4)2112)
#define KADMVERS ((krb5_ui_4)2)
#define CREATE_PRINCIPAL ((krb5_ui_4)1)
struct svc_req *rqstp);
extern generic_ret *setkey_principal3_1(setkey3_arg *argp, CLIENT *clnt);
+#define GET_GENERATION_NUMBER ((krb5_ui_4) 22)
+extern getgeneration_ret *getgeneration_4_svc(getgeneration_arg *arg,
+ struct svc_req *rqstp);
+extern getgeneration_ret *getgeneration_4(getgeneration_arg *argp,
+ CLIENT *clnt);
+
#endif /* __KADM_RPC_H__ */
return TRUE;
}
+bool_t xdr_getgeneration_arg(XDR *xdrs, getgeneration_arg *objp)
+{
+ if (!xdr_ui_4(xdrs, &objp->api_version)) {
+ return (FALSE);
+ }
+ return (TRUE);
+}
+
+bool_t xdr_getgeneration_ret(XDR *xdrs, getgeneration_ret *objp)
+{
+ if (!xdr_ui_4(xdrs, &objp->api_version)) {
+ return (FALSE);
+ }
+ if (!xdr_kadm5_ret_t(xdrs, &objp->code)) {
+ return (FALSE);
+ }
+ if (objp->code == KADM5_OK) {
+ if (!xdr_int32(xdrs, &objp->generation)) {
+ return (FALSE);
+ }
+ }
+ return (TRUE);
+}
+
bool_t
xdr_krb5_principal(XDR *xdrs, krb5_principal *objp)
{
krb5_db_entry *kdb, osa_princ_ent_rec *adb);
krb5_error_code kdb_put_entry(kadm5_server_handle_t handle,
krb5_db_entry *kdb, osa_princ_ent_rec *adb);
+krb5_error_code kdb_put_entry_internal(kadm5_server_handle_t handle,
+ krb5_db_entry *kdb,
+ osa_princ_ent_rec *adb, int incgen,
+ int updatemod);
krb5_error_code kdb_delete_entry(kadm5_server_handle_t handle,
krb5_principal name);
+krb5_error_code kdb_update_generation_number(kadm5_server_handle_t handle);
int init_dict(kadm5_config_params *);
int find_word(const char *word);