Use the KRB5_KTNAME environment variable to override the default
authorTheodore Tso <tytso@mit.edu>
Sat, 20 May 1995 02:10:55 +0000 (02:10 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 20 May 1995 02:10:55 +0000 (02:10 +0000)
location of the keytab.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5826 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/ktdefname.c

index cee01f0fa153dff13890a8ee61903aba9afa2da2..bbb38acd8d51291adbdf3b2e6343e9cc780a3322 100644 (file)
@@ -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    <tytso@rsx-11.mit.edu>
+
+       * 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  <epeisach@kangaroo.mit.edu>
 
        * read_pwd.c (krb5_read_password): use volatile on all
index d6321eb46b73d19eacf7880606e9d009b2e4af20..fdb685b20ec41e7009d77a2def89ab2971d3d601 100644 (file)
@@ -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;
 }