From 44df097a094eff6e80a9a3c9df0b719e132885fc Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 14 Oct 1996 06:29:15 +0000 Subject: [PATCH] Misc debugging cleanups [71, 74] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9164 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnetd/ChangeLog | 5 +++++ src/appl/telnet/telnetd/utility.c | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index f18486b2f..f78f53f25 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,4 +1,9 @@ +Mon Oct 14 01:55:41 1996 Sam Hartman + + * utility.c (printsub): Patch from jhawk@bbnplannet.com to deal + with bug printing out authentication name. [71] Sat Sep 21 03:38:31 1996 Sam Hartman +(printsub): Fix encrypt promise bit option parsing [74] * utility.c (ttloop): Continue on eintr. diff --git a/src/appl/telnet/telnetd/utility.c b/src/appl/telnet/telnetd/utility.c index 7b72e80a5..eb31a76a1 100644 --- a/src/appl/telnet/telnetd/utility.c +++ b/src/appl/telnet/telnetd/utility.c @@ -982,11 +982,13 @@ printsub(direction, pointer, length) nfrontp += strlen(nfrontp); break; } - sprintf(nfrontp, "%s|%s", + sprintf(nfrontp, "%s|%s%s", ((pointer[3] & AUTH_WHO_MASK) == AUTH_WHO_CLIENT) ? "CLIENT" : "SERVER", ((pointer[3] & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) ? - "MUTUAL" : "ONE-WAY"); + "MUTUAL" : "ONE-WAY", + ((pointer[3] & AUTH_ENCRYPT_MASK) == AUTH_ENCRYPT_ON) ? + "|ENCRYPT" : ""); nfrontp += strlen(nfrontp); auth_printsub(&pointer[1], length - 1, buf, sizeof(buf)); @@ -1009,11 +1011,13 @@ printsub(direction, pointer, length) nfrontp += strlen(nfrontp); break; } - sprintf(nfrontp, "%s|%s ", + sprintf(nfrontp, "%s|%s%s ", ((pointer[i] & AUTH_WHO_MASK) == AUTH_WHO_CLIENT) ? "CLIENT" : "SERVER", ((pointer[i] & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) ? - "MUTUAL" : "ONE-WAY"); + "MUTUAL" : "ONE-WAY", + ((pointer[3] & AUTH_ENCRYPT_MASK) == AUTH_ENCRYPT_ON) ? + "|ENCRYPT" : ""); nfrontp += strlen(nfrontp); ++i; } @@ -1023,9 +1027,15 @@ printsub(direction, pointer, length) i = 2; sprintf(nfrontp, " NAME \""); nfrontp += strlen(nfrontp); - while (i < length) - *nfrontp += pointer[i++]; - *nfrontp += '"'; + while (i < length) { + if (isprint(pointer[i])) + *nfrontp++ = pointer[i++]; + else { + sprintf(nfrontp, "\"%03o",pointer[i++]); + nfrontp += strlen(nfrontp); + } + } + *nfrontp++ = '"'; break; default: -- 2.26.2