From: Richard Basch Date: Thu, 9 May 1996 16:01:08 +0000 (+0000) Subject: krlogind.c krshd.c: X-Git-Tag: krb5-1.0-beta6~118 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=db1c498c1f8409c079ae1f6d7707e110f939318a;p=krb5.git krlogind.c krshd.c: Use the default service principal as the basis for the rcache name. login.c: SVR4 systems typically do not do mail/motd checks in login; they do it in the profiles (/etc/profile). Follow that convention... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7951 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 21e8a1277..25ac16152 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,14 @@ +Thu May 9 00:09:14 1996 Richard Basch + + * krlogind.c krshd.c: + Use the replay cache associated with the default server name + (rc_host*), like telnetd does. + +Mon May 6 14:06:21 1996 Richard Basch + + * login.c: SVR4 logins do not do motd or mailcheck normally; that + is a function of /etc/profile. login.krb should act the same... + Mon Apr 29 17:02:44 1996 Ken Raeburn Merge with Cygnus sources, changes from Mark Eichin, Marc diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index 0a44c8deb..f016fcd7b 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -1413,6 +1413,7 @@ recvauth(valid_checksum) char v4_instance[INST_SZ]; /* V4 Instance */ char v4_version[9]; krb5_authenticator *authenticator; + krb5_rcache rcache; *valid_checksum = 0; len = sizeof(laddr); @@ -1436,6 +1437,26 @@ recvauth(valid_checksum) KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR))) return status; + status = krb5_auth_con_getrcache(bsd_context, auth_context, &rcache); + if (status) return status; + + if (! rcache) { + krb5_principal server; + + status = krb5_sname_to_principal(bsd_context, 0, 0, + KRB5_NT_SRV_HST, &server); + if (status) return status; + + status = krb5_get_server_rcache(bsd_context, + krb5_princ_component(bsd_context, server, 0), + &rcache); + krb5_free_principal(bsd_context, server); + if (status) return status; + + status = krb5_auth_con_setrcache(bsd_context, auth_context, rcache); + if (status) return status; + } + if ((status = krb5_compat_recvauth(bsd_context, &auth_context, &netf, "KCMDV0.1", NULL, /* Specify daemon principal */ diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index 64b1b2974..74e701db9 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -1682,8 +1682,9 @@ recvauth(netf, peersin, valid_checksum) krb5_data inbuf; char v4_instance[INST_SZ]; /* V4 Instance */ char v4_version[9]; -krb5_authenticator *authenticator; + krb5_authenticator *authenticator; krb5_ticket *ticket; + krb5_rcache rcache; *valid_checksum = 0; len = sizeof(laddr); @@ -1706,6 +1707,26 @@ krb5_authenticator *authenticator; KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR)) return status; + status = krb5_auth_con_getrcache(bsd_context, auth_context, &rcache); + if (status) return status; + + if (! rcache) { + krb5_principal server; + + status = krb5_sname_to_principal(bsd_context, 0, 0, + KRB5_NT_SRV_HST, &server); + if (status) return status; + + status = krb5_get_server_rcache(bsd_context, + krb5_princ_component(bsd_context, server, 0), + &rcache); + krb5_free_principal(bsd_context, server); + if (status) return status; + + status = krb5_auth_con_setrcache(bsd_context, auth_context, rcache); + if (status) return status; + } + status = krb5_compat_recvauth(bsd_context, &auth_context, &netf, "KCMDV0.1", NULL, /* Specify daemon principal */ diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index 778d73d4e..34bbaec91 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -260,6 +260,11 @@ extern int errno; passsword */ #endif /* KRB4_GET_TICKETS */ +#ifdef __SVR4 +#define NO_MOTD +#define NO_MAILCHECK +#endif + char *getenv(); void dofork(); @@ -1994,6 +1999,7 @@ void motd() void motd () { } #endif +#ifndef NO_MAILCHECK void check_mail () { char tbuf[MAXPATHLEN+2]; @@ -2003,6 +2009,9 @@ void check_mail () printf("You have %smail.\n", (st.st_mtime > st.st_atime) ? "new " : ""); } +#else +void check_mail () { } +#endif void checknologin() {