(krb5_kt_default_modify_name): add
(krb5_kt_resolve): set error string for failed keytab type git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9879 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -89,8 +89,11 @@ krb5_kt_resolve(krb5_context context,
|
|||||||
if(strncmp(type, context->kt_types[i].prefix, type_len) == 0)
|
if(strncmp(type, context->kt_types[i].prefix, type_len) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(i == context->num_kt_types)
|
if(i == context->num_kt_types) {
|
||||||
|
krb5_set_error_string(context, "unknown keytype type %.*s",
|
||||||
|
(int)type_len, type);
|
||||||
return KRB5_KT_UNKNOWN_TYPE;
|
return KRB5_KT_UNKNOWN_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
k = malloc (sizeof(*k));
|
k = malloc (sizeof(*k));
|
||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
@@ -119,6 +122,19 @@ krb5_kt_default_name(krb5_context context, char *name, size_t namesize)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* copy the name of the default modify keytab into `name'.
|
||||||
|
* Return 0 or KRB5_CONFIG_NOTENUFSPACE if `namesize' is too short.
|
||||||
|
*/
|
||||||
|
|
||||||
|
krb5_error_code
|
||||||
|
krb5_kt_default_modify_name(krb5_context context, char *name, size_t namesize)
|
||||||
|
{
|
||||||
|
if (strlcpy (name, context->default_keytab_modify, namesize) >= namesize)
|
||||||
|
return KRB5_CONFIG_NOTENUFSPACE;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set `id' to the default keytab.
|
* Set `id' to the default keytab.
|
||||||
* Return 0 or an error.
|
* Return 0 or an error.
|
||||||
|
Reference in New Issue
Block a user