summaryrefslogtreecommitdiffstats
path: root/src/appl/telnet/libtelnet/forward.c
diff options
context:
space:
mode:
authorMark Eichin <eichin@mit.edu>1995-11-13 01:26:12 +0000
committerMark Eichin <eichin@mit.edu>1995-11-13 01:26:12 +0000
commitebe421dfcd96d130bcc1ea8cbdff17bf27c7d1cf (patch)
tree64bb05d9acaeaea6ddff1f2556a1529cc509823f /src/appl/telnet/libtelnet/forward.c
parentade6a0e649fdfb15bae1ec0d86dfe5c6d691e8ee (diff)
downloadkrb5-ebe421dfcd96d130bcc1ea8cbdff17bf27c7d1cf.tar.gz
krb5-ebe421dfcd96d130bcc1ea8cbdff17bf27c7d1cf.tar.xz
krb5-ebe421dfcd96d130bcc1ea8cbdff17bf27c7d1cf.zip
* forward.c: set KRB5_DEFAULT_LIFE to 10 hours, not 8.
* forward.c (rd_and_store_for_creds): construct correct cache name for forwarded tickets (based on tty name if available) and drop it into the environment so login notices it. also, fix typo in comment in kerberos5.c git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7090 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/telnet/libtelnet/forward.c')
-rw-r--r--src/appl/telnet/libtelnet/forward.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/appl/telnet/libtelnet/forward.c b/src/appl/telnet/libtelnet/forward.c
index 7e1d78e8d..c86a28a65 100644
--- a/src/appl/telnet/libtelnet/forward.c
+++ b/src/appl/telnet/libtelnet/forward.c
@@ -30,6 +30,8 @@
#include "k5-int.h"
+extern char *line; /* see sys_term.c */
+
/* Decode, decrypt and store the forwarded creds in the local ccache. */
krb5_error_code
rd_and_store_for_creds(context, auth_context, inbuf, ticket, lusername)
@@ -51,7 +53,14 @@ rd_and_store_for_creds(context, auth_context, inbuf, ticket, lusername)
if (retval = krb5_rd_cred(context, auth_context, inbuf, &creds, NULL))
return(retval);
- sprintf(ccname, "FILE:/tmp/krb5cc_%d", pwd->pw_uid);
+ if (*line) {
+ /* code from appl/bsd/login.c since it will do the same */
+ sprintf(ccname, "FILE:/tmp/krb5cc_%s", strrchr(line, '/')+1);
+ } else {
+ /* since default will be based on uid and we haven't changed yet */
+ sprintf(ccname, "FILE:/tmp/krb5cc_%d", pwd->pw_uid);
+ }
+ setenv(KRB5_ENV_CCNAME, ccname, 1);
if (retval = krb5_cc_resolve(context, ccname, &ccache))
goto cleanup;
@@ -71,7 +80,7 @@ cleanup:
}
-#define KRB5_DEFAULT_LIFE 60*60*8 /* 8 hours */
+#define KRB5_DEFAULT_LIFE 60*60*10 /* 10 hours */
/* helper function: convert flags to necessary KDC options */
#define flags2options(flags) (flags & KDC_TKT_COMMON_MASK)