From: Ken Raeburn Date: Wed, 1 Sep 1999 21:51:42 +0000 (+0000) Subject: from 1.1 branch: X-Git-Tag: krb5-1.2-beta1~251 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1b1905a9ed467f428ea3b4732d184aea42311b83;p=krb5.git from 1.1 branch: * krlogin.c (main): Error out if -D isn't followed by another argument. Based on patch from Brad Thompson. * krshd.c (v4_kdata, v4_ticket): Don't define if KRB5_KRB4_COMPAT is not defined. Patch from Brad Thompson. * kcmd.c (kcmd): If krb5_get_credentials returns a nonzero error code, print an error message before returning. * krlogin.c (main): If ospeed is outside of compiled-in table index range but not high enough to be a baud rate, use the highest rate in the table. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11777 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 629dcfb1f..6108bdb2d 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,18 @@ +1999-09-01 Ken Raeburn + + * krlogin.c (main): Error out if -D isn't followed by another + argument. Based on patch from Brad Thompson. + + * krshd.c (v4_kdata, v4_ticket): Don't define if KRB5_KRB4_COMPAT + is not defined. Patch from Brad Thompson. + + * kcmd.c (kcmd): If krb5_get_credentials returns a nonzero error + code, print an error message before returning. + + * krlogin.c (main): If ospeed is outside of compiled-in table + index range but not high enough to be a baud rate, use the highest + rate in the table. + 1999-08-24 Tom Yu * Makefile.in (kshd): Remove $(LOGINLIBS) from kshd dependencies. diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c index 6b0eafcde..0e68f88e7 100644 --- a/src/appl/bsd/kcmd.c +++ b/src/appl/bsd/kcmd.c @@ -339,7 +339,11 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm, status = krb5_get_credentials(bsd_context, 0, cc, get_cred, &ret_cred); krb5_free_creds(bsd_context, get_cred); (void) krb5_cc_close(bsd_context, cc); - if (status) goto bad2; + if (status) { + fprintf (stderr, "error getting credentials: %s\n", + error_message (status)); + goto bad2; + } /* Reset internal flags; these should not be sent. */ authopts &= (~OPTS_FORWARD_CREDS); diff --git a/src/appl/bsd/krlogin.c b/src/appl/bsd/krlogin.c index 0bfb3ef57..0a8e7902e 100644 --- a/src/appl/bsd/krlogin.c +++ b/src/appl/bsd/krlogin.c @@ -383,6 +383,11 @@ main(argc, argv) if (argc > 0 && !strcmp(*argv, "-D")) { argv++; argc--; + if (*argv == NULL) { + fprintf (stderr, + "rlogin: -D flag must be followed by the debug port.\n"); + exit (1); + } debug_port = htons(atoi(*argv)); argv++; argc--; goto another; @@ -545,6 +550,10 @@ main(argc, argv) /* On some systems, ospeed is the baud rate itself, not a table index. */ sprintf (term + strlen (term), "%d", ospeed); + else if (ospeed >= sizeof(speeds)/sizeof(char*)) + /* Past end of table, but not high enough to + look like a real speed. */ + (void) strcat (term, speeds[sizeof(speeds)/sizeof(char*) - 1]); else { (void) strcat(term, speeds[ospeed]); } diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index 2a1391704..3844087bb 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -529,8 +529,10 @@ char *kremuser; krb5_principal client; krb5_authenticator *kdata; +#ifdef KRB5_KRB4_COMPAT AUTH_DAT *v4_kdata; KTEXT v4_ticket; +#endif int auth_sys = 0; /* Which version of Kerberos used to authenticate */