* generic/gssapiP_generic.h (g_set): New struct type.
(G_SET_INIT): New macro.
* generic/util_validate.c (g_save, g_validate, g_delete): Change first argument
to take a g_set * rather than void **; use the address of the void pointer from
the structure.
(g_save_name, g_save_cred_id, g_save_ctx_id, g_validate_name,
g_validate_cred_id, g_validate_ctx_id, g_delete_name, g_delete_cred_id,
g_delete_ctx_id): Updated first argument type.
* genericgssapiP_generic.h: Declarations updated.
* krb5/gssapi_krb5.c (kg_vdb): Change type to g_set and initialize.
* krb5/gssapiP_krb5.h (kg_vdb): Declaration updated.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16166
dc483132-0cff-0310-8789-
dd5450dbe970
non-_elt versions.
* util_set.c, util_validate.c: Uses updated.
+ * gssapiP_generic.h (g_set): New struct type.
+ (G_SET_INIT): New macro.
+ * util_validate.c (g_save, g_validate, g_delete): Change first
+ argument to take a g_set * rather than void **; use the address of
+ the void pointer from the structure.
+ (g_save_name, g_save_cred_id, g_save_ctx_id, g_validate_name,
+ g_validate_cred_id, g_validate_ctx_id, g_delete_name,
+ g_delete_cred_id, g_delete_ctx_id): Updated first argument type.
+ * gssapiP_generic.h: Declarations updated.
+
2004-02-08 Ken Raeburn <raeburn@mit.edu>
* util_ordering.c (g_queue_externalize, g_queue_internalize):
#define g_strdup gssint_g_strdup
typedef struct _g_set_elt *g_set_elt;
+typedef struct {
+ /* k5_mutex_t mutex; */
+ void *data;
+} g_set;
+#define G_SET_INIT { /* K5_MUTEX_INITIALIZER, */ 0 }
int g_set_init (g_set_elt *s);
int g_set_destroy (g_set_elt *s);
int g_set_entry_delete (g_set_elt *s, void *key);
int g_set_entry_get (g_set_elt *s, void *key, void **value);
-int g_save_name (void **vdb, gss_name_t *name);
-int g_save_cred_id (void **vdb, gss_cred_id_t *cred);
-int g_save_ctx_id (void **vdb, gss_ctx_id_t *ctx);
+int g_save_name (g_set *vdb, gss_name_t *name);
+int g_save_cred_id (g_set *vdb, gss_cred_id_t *cred);
+int g_save_ctx_id (g_set *vdb, gss_ctx_id_t *ctx);
-int g_validate_name (void **vdb, gss_name_t *name);
-int g_validate_cred_id (void **vdb, gss_cred_id_t *cred);
-int g_validate_ctx_id (void **vdb, gss_ctx_id_t *ctx);
+int g_validate_name (g_set *vdb, gss_name_t *name);
+int g_validate_cred_id (g_set *vdb, gss_cred_id_t *cred);
+int g_validate_ctx_id (g_set *vdb, gss_ctx_id_t *ctx);
-int g_delete_name (void **vdb, gss_name_t *name);
-int g_delete_cred_id (void **vdb, gss_cred_id_t *cred);
-int g_delete_ctx_id (void **vdb, gss_ctx_id_t *ctx);
+int g_delete_name (g_set *vdb, gss_name_t *name);
+int g_delete_cred_id (g_set *vdb, gss_cred_id_t *cred);
+int g_delete_ctx_id (g_set *vdb, gss_ctx_id_t *ctx);
int g_make_string_buffer (const char *str, gss_buffer_t buffer);
#endif
#include <fcntl.h>
#include <limits.h>
+
#ifdef HAVE_BSD_DB
#include <sys/file.h>
#include <db.h>
/* All these functions return 0 on failure, and non-zero on success */
static int g_save(db, type, ptr)
- void **db;
+ g_set *db;
#ifdef HAVE_BSD_DB
int type;
#else
void *ptr;
{
#ifdef HAVE_BSD_DB
- DB **vdb = (DB **) db;
+ DB **vdb = (DB **) &db->data;
vkey vk;
DBT key;
return((*((*vdb)->put))(*vdb, &key, &dbtone, 0) == 0);
#else
- g_set_elt *gs = (g_set_elt *) db;
+ g_set_elt *gs = (g_set_elt *) &db->data;
if (!*gs)
if (g_set_init(gs))
}
static int g_validate(db, type, ptr)
- void **db;
+ g_set *db;
#ifdef HAVE_BSD_DB
int type;
#else
void *ptr;
{
#ifdef HAVE_BSD_DB
- DB **vdb = (DB **) db;
+ DB **vdb = (DB **) &db->data;
vkey vk;
DBT key, value;
return((value.size == sizeof(one)) &&
(*((int *) value.data) == one));
#else
- g_set_elt *gs = (g_set_elt *) db;
+ g_set_elt *gs = (g_set_elt *) &db->data;
void *value;
if (!*gs)
}
static int g_delete(db, type, ptr)
- void **db;
+ g_set *db;
#ifdef HAVE_BSD_DB
int type;
#else
void *ptr;
{
#ifdef HAVE_BSD_DB
- DB **vdb = (DB **) db;
+ DB **vdb = (DB **) &db->data;
vkey vk;
DBT key;
return((*((*vdb)->del))(*vdb, &key, 0) == 0);
#else
- g_set_elt *gs = (g_set_elt *) db;
+ g_set_elt *gs = (g_set_elt *) &db->data;
if (!*gs)
return(0);
/* save */
int g_save_name(vdb, name)
- void **vdb;
+ g_set *vdb;
gss_name_t *name;
{
return(g_save(vdb, V_NAME, (void *) name));
}
int g_save_cred_id(vdb, cred)
- void **vdb;
+ g_set *vdb;
gss_cred_id_t *cred;
{
return(g_save(vdb, V_CRED_ID, (void *) cred));
}
int g_save_ctx_id(vdb, ctx)
- void **vdb;
+ g_set *vdb;
gss_ctx_id_t *ctx;
{
return(g_save(vdb, V_CTX_ID, (void *) ctx));
/* validate */
int g_validate_name(vdb, name)
- void **vdb;
+ g_set *vdb;
gss_name_t *name;
{
return(g_validate(vdb, V_NAME, (void *) name));
}
int g_validate_cred_id(vdb, cred)
- void **vdb;
+ g_set *vdb;
gss_cred_id_t *cred;
{
return(g_validate(vdb, V_CRED_ID, (void *) cred));
}
int g_validate_ctx_id(vdb, ctx)
- void **vdb;
+ g_set *vdb;
gss_ctx_id_t *ctx;
{
return(g_validate(vdb, V_CTX_ID, (void *) ctx));
/* delete */
int g_delete_name(vdb, name)
- void **vdb;
+ g_set *vdb;
gss_name_t *name;
{
return(g_delete(vdb, V_NAME, (void *) name));
}
int g_delete_cred_id(vdb, cred)
- void **vdb;
+ g_set *vdb;
gss_cred_id_t *cred;
{
return(g_delete(vdb, V_CRED_ID, (void *) cred));
}
int g_delete_ctx_id(vdb, ctx)
- void **vdb;
+ g_set *vdb;
gss_ctx_id_t *ctx;
{
return(g_delete(vdb, V_CTX_ID, (void *) ctx));
+2004-03-14 Ken Raeburn <raeburn@mit.edu>
+
+ * gssapi_krb5.c (kg_vdb): Change type to g_set and initialize.
+ * gssapiP_krb5.h (kg_vdb): Declaration updated.
+
2004-03-08 Ezra Peisach <epeisach@mit.edu>
* gssapiP_krb5.h: Add prototype for gss_krb5int_unseal_token_v3.
#endif
} krb5_gss_ctx_id_rec, *krb5_gss_ctx_id_t;
-extern void *kg_vdb;
+extern g_set kg_vdb;
/* helper macros */
const gss_OID_set_desc * const gss_mech_set_krb5_old = oidsets+1;
const gss_OID_set_desc * const gss_mech_set_krb5_both = oidsets+2;
-void *kg_vdb = NULL;
+g_set kg_vdb = G_SET_INIT;
static char *kg_ccache_name = NULL;
/** default credential support */