static krb5_error_code KRB5_CALLCONV
krb5_ktfile_resolve(krb5_context, const char *, krb5_keytab *);
-static krb5_error_code KRB5_CALLCONV
-krb5_ktfile_wresolve(krb5_context, const char *, krb5_keytab *);
-
static krb5_error_code KRB5_CALLCONV
krb5_ktfile_get_name(krb5_context, krb5_keytab, char *, unsigned int);
*/
static krb5_error_code
-ktfile_common_resolve(krb5_context context, const char *name,
- krb5_keytab *idptr, const struct _krb5_kt_ops *ops)
+krb5_ktfile_resolve(krb5_context context, const char *name,
+ krb5_keytab *id_out)
{
krb5_ktfile_data *data = NULL;
krb5_error_code err = ENOMEM;
krb5_keytab id;
- *idptr = NULL;
+ *id_out = NULL;
id = calloc(1, sizeof(*id));
if (id == NULL)
return ENOMEM;
- id->ops = ops;
+ id->ops = &krb5_ktf_ops;
data = calloc(1, sizeof(krb5_ktfile_data));
if (data == NULL)
goto cleanup;
id->data = (krb5_pointer) data;
id->magic = KV5M_KEYTAB;
- *idptr = id;
+ *id_out = id;
return 0;
cleanup:
if (data)
return err;
}
-static krb5_error_code KRB5_CALLCONV
-krb5_ktfile_resolve(krb5_context context, const char *name, krb5_keytab *id)
-{
- return ktfile_common_resolve(context, name, id, &krb5_ktf_writable_ops);
-}
-
/*
* "Close" a file-based keytab and invalidate the id. This means
if (kret)
goto cleanup;
- if (keytab->ops != &krb5_ktf_writable_ops
- && keytab->ops != &krb5_ktf_ops) {
+ if (keytab->ops != &krb5_ktf_ops) {
kret = EINVAL;
goto cleanup;
}
return kret;
}
-/*
- * This is an implementation specific resolver. It returns a keytab id
- * initialized with file keytab routines.
- */
-
-static krb5_error_code KRB5_CALLCONV
-krb5_ktfile_wresolve(krb5_context context, const char *name, krb5_keytab *id)
-{
- return ktfile_common_resolve(context, name, id, &krb5_ktf_writable_ops);
-}
-
/*
* krb5_ktfile_add()
krb5_ktfile_start_seq_get,
krb5_ktfile_get_next,
krb5_ktfile_end_get,
- 0,
- 0,
+ krb5_ktfile_add,
+ krb5_ktfile_remove,
&krb5_ktfile_ser_entry
};
/*
- * krb5_ktf_writable_ops
+ * krb5_ktf_writable_ops -- this is the same as krb5_ktf_ops except for the
+ * prefix. WRFILE should no longer be needed, but is effectively aliased to
+ * FILE for compatibility.
*/
const struct _krb5_kt_ops krb5_ktf_writable_ops = {
0,
"WRFILE", /* Prefix -- this string should not appear anywhere else! */
- krb5_ktfile_wresolve,
+ krb5_ktfile_resolve,
krb5_ktfile_get_name,
krb5_ktfile_close,
krb5_ktfile_get_entry,