Permalink
Browse files

Bring in v4 compatability fix and

secure message fix.


git-svn-id: svn://anonsvn.mit.edu/krb5/branches/ops_snapshot1@7468 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information...
1 parent d15fd68 commit a4a4c405f8cfb29fbb96ce41c7e2f39a285e5c35 hartmans committed Feb 10, 1996
Showing with 34 additions and 31 deletions.
  1. +32 −30 src/appl/bsd/krlogind.c
  2. +2 −1 src/appl/bsd/krsh.c
View
62 src/appl/bsd/krlogind.c
@@ -1523,7 +1523,7 @@ recvauth(valid_checksum)
&auth_sys, /* which authentication system*/
&v4_kdata, v4_schedule, v4_version)) {
- if (auth_sys == KRB5_RECVAUTH_V5) {
+ if (auth_sys == KRB5_RECVAUTH_V5) {
/*
* clean up before exiting
*/
@@ -1536,40 +1536,42 @@ recvauth(valid_checksum)
getstr(netf, lusername, sizeof (lusername), "locuser");
getstr(netf, term, sizeof(term), "Terminal type");
- if (status = krb5_auth_con_getauthenticator(bsd_context, auth_context, &authenticator))
- return status;
+ if (auth_sys == KRB5_RECVAUTH_V5) {
+
+ if(status = krb5_auth_con_getauthenticator(bsd_context, auth_context, &authenticator))
+ return status;
- if (authenticator->checksum) {
+ if (authenticator->checksum) {
struct sockaddr_in adr;
int adr_length = sizeof(adr);
- char * chksumbuf = (char *) malloc(strlen(term)+strlen(lusername)+32);
+ char * chksumbuf = (char *) malloc(strlen(term)+strlen(lusername)+32);
if (getsockname(netf, (struct sockaddr *) &adr, &adr_length) != 0)
- return errno;
- if (chksumbuf == 0)
- goto error_cleanup;
-
- sprintf(chksumbuf,"%u:", ntohs(adr.sin_port));
- strcat(chksumbuf,term);
- strcat(chksumbuf,lusername);
-
- if ( status = krb5_verify_checksum(bsd_context,
- authenticator->checksum->checksum_type,
- authenticator->checksum,
- chksumbuf, strlen(chksumbuf),
- ticket->enc_part2->session->contents,
- ticket->enc_part2->session->length))
- goto error_cleanup;
-
- error_cleanup:
-krb5_xfree(chksumbuf);
- if (status) {
- krb5_free_authenticator(bsd_context, authenticator);
- return status;
- }
+ return errno;
+ if (chksumbuf == 0)
+ goto error_cleanup;
+
+ sprintf(chksumbuf,"%u:", ntohs(adr.sin_port));
+ strcat(chksumbuf,term);
+ strcat(chksumbuf,lusername);
+
+ if ( status = krb5_verify_checksum(bsd_context,
+ authenticator->checksum->checksum_type,
+ authenticator->checksum,
+ chksumbuf, strlen(chksumbuf),
+ ticket->enc_part2->session->contents,
+ ticket->enc_part2->session->length))
+ goto error_cleanup;
+
+ error_cleanup:
+ krb5_xfree(chksumbuf);
+ if (status) {
+ krb5_free_authenticator(bsd_context, authenticator);
+ return status;
+ }
*valid_checksum = 1;
-}
- krb5_free_authenticator(bsd_context, authenticator);
-
+ }
+ krb5_free_authenticator(bsd_context, authenticator);
+ }
#ifdef KRB5_KRB4_COMPAT
View
3 src/appl/bsd/krsh.c
@@ -374,7 +374,7 @@ main(argc, argv0)
exit(1);
}
#ifdef HAVE_ISATTY
- if(isatty(2)) {
+ if(encrypt_flag&&isatty(2)) {
write(2,SECURE_MESSAGE, strlen(SECURE_MESSAGE));
}
#endif
@@ -684,3 +684,4 @@ int des_write(fd, buf, len)
else return(len);
}
#endif /* KERBEROS */
+

0 comments on commit a4a4c40

Please sign in to comment.