From: Theodore Tso Date: Sat, 20 May 1995 02:10:55 +0000 (+0000) Subject: Use the KRB5_KTNAME environment variable to override the default X-Git-Tag: krb5-1.0-beta6~1971 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e8ce77ab3b3c95819186175eca7b97f99147e8ec;p=krb5.git Use the KRB5_KTNAME environment variable to override the default location of the keytab. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5826 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index cee01f0fa..bbb38acd8 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,9 +1,14 @@ - Tue May 16 10:33:03 EDT 1995 Paul Park (pjpark@mit.edu) * gmt_mktime.c - Use the actual year instead of the number of years since 1900 when determining if a year has a leapday. Makes dates after February in the year 2000 correct. +Mon May 15 05:08:05 1995 + + * ktdefname.c (krb5_kt_default_name): Use the KRB5_KTNAME + environment variable to override the default location of + the keytab. + Mon May 8 22:19:23 1995 Ezra Peisach * read_pwd.c (krb5_read_password): use volatile on all diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index d6321eb46..fdb685b20 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -34,10 +34,18 @@ krb5_kt_default_name(context, name, namesize) char *name; int namesize; { - strncpy(name, krb5_defkeyname, namesize); - if ((size_t) namesize < strlen(krb5_defkeyname)) - return KRB5_CONFIG_NOTENUFSPACE; - else - return 0; + char *cp; + + cp = getenv("KRB5_KTNAME"); + if (cp) { + strncpy(name, cp, namesize); + if (strlen(cp) >= namesize) + return KRB5_CONFIG_NOTENUFSPACE; + } else { + strncpy(name, krb5_defkeyname, namesize); + if ((size_t) namesize < strlen(krb5_defkeyname)) + return KRB5_CONFIG_NOTENUFSPACE; + } + return 0; }