(kcm_alloc): allow kcm socket to be configured by [libdefaults]kcm_socket=/path

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15222 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-05-24 12:49:20 +00:00
parent d1f9671126
commit 1811dedf7b

View File

@@ -143,6 +143,7 @@ static krb5_error_code
kcm_alloc(krb5_context context, const char *name, krb5_ccache *id)
{
krb5_kcmcache *k;
const char *path;
k = malloc(sizeof(*k));
if (k == NULL) {
@@ -160,8 +161,14 @@ kcm_alloc(krb5_context context, const char *name, krb5_ccache *id)
} else
k->name = NULL;
path = krb5_config_get_string_default(context, NULL,
_PATH_KCM_SOCKET,
"libdefaults",
"kcm_socket",
NULL);
k->path.sun_family = AF_UNIX;
strlcpy(k->path.sun_path, _PATH_KCM_SOCKET, sizeof(k->path.sun_path));
strlcpy(k->path.sun_path, path, sizeof(k->path.sun_path));
(*id)->data.data = k;
(*id)->data.length = sizeof(*k);