summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-11-08 04:39:02 +0000
committerTheodore Tso <tytso@mit.edu>1994-11-08 04:39:02 +0000
commite2a39f0f1dd6193ffae41d369f3aad85a66603bc (patch)
tree6c91597cce94f05aacee59437b0808393b15252a /src
parent19ed86acd0ce2c8be84e2433c69949448ff8220f (diff)
downloadkrb5-e2a39f0f1dd6193ffae41d369f3aad85a66603bc.tar.gz
krb5-e2a39f0f1dd6193ffae41d369f3aad85a66603bc.tar.xz
krb5-e2a39f0f1dd6193ffae41d369f3aad85a66603bc.zip
Only print each possible authentication type once in the auth status
report. Remove excess call to getauthmask() in auth_onoff() which stomped the mask field. Only print each possible authentication type once in the help message. Fix reversed sense of strcasecmp comparison in getauthmask(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4642 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/appl/telnet/libtelnet/ChangeLog10
-rw-r--r--src/appl/telnet/libtelnet/auth.c20
2 files changed, 25 insertions, 5 deletions
diff --git a/src/appl/telnet/libtelnet/ChangeLog b/src/appl/telnet/libtelnet/ChangeLog
index 6a71f9416..4697b6ee1 100644
--- a/src/appl/telnet/libtelnet/ChangeLog
+++ b/src/appl/telnet/libtelnet/ChangeLog
@@ -1,5 +1,15 @@
Mon Nov 7 22:36:20 1994 Theodore Y. Ts'o (tytso@dcl)
+ * auth.c (auth_status): Only print each possible authentication
+ type once in the status report.
+
+ * auth.c (auth_onoff): Remove excess call to getauthmask() which
+ stomped the mask field. Only print each possible
+ authentication type once in the help message.
+
+ * auth.c (getauthmask): Fix reversed sense of strcasecmp
+ comparison.
+
* auth.c (auth_enable, auth_disable): Change the input type to be
a char *, which is what auth_onoff wants anyway.
diff --git a/src/appl/telnet/libtelnet/auth.c b/src/appl/telnet/libtelnet/auth.c
index 60f5ed6be..2587a561e 100644
--- a/src/appl/telnet/libtelnet/auth.c
+++ b/src/appl/telnet/libtelnet/auth.c
@@ -244,7 +244,7 @@ getauthmask(type, maskp)
{
register int x;
- if (strcasecmp(type, AUTHTYPE_NAME(0))) {
+ if (!strcasecmp(type, AUTHTYPE_NAME(0))) {
*maskp = -1;
return(1);
}
@@ -277,15 +277,20 @@ auth_onoff(type, on)
char *type;
int on;
{
- int mask = -1;
+ int i, mask = -1;
Authenticator *ap;
if (!strcasecmp(type, "?") || !strcasecmp(type, "help")) {
printf("auth %s 'type'\n", on ? "enable" : "disable");
printf("Where 'type' is one of:\n");
printf("\t%s\n", AUTHTYPE_NAME(0));
- for (ap = authenticators; ap->type; ap++)
+ mask = 0;
+ for (ap = authenticators; ap->type; ap++) {
+ if ((mask & (i = typemask(ap->type))) != 0)
+ continue;
+ mask |= i;
printf("\t%s\n", AUTHTYPE_NAME(ap->type));
+ }
return(0);
}
@@ -293,7 +298,6 @@ auth_onoff(type, on)
printf("%s: invalid authentication type\n", type);
return(0);
}
- mask = getauthmask(type, &mask);
if (on)
i_wont_support &= ~mask;
else
@@ -317,16 +321,22 @@ auth_togdebug(on)
auth_status()
{
Authenticator *ap;
+ int i, mask;
if (i_wont_support == -1)
printf("Authentication disabled\n");
else
printf("Authentication enabled\n");
- for (ap = authenticators; ap->type; ap++)
+ mask = 0;
+ for (ap = authenticators; ap->type; ap++) {
+ if ((mask & (i = typemask(ap->type))) != 0)
+ continue;
+ mask |= i;
printf("%s: %s\n", AUTHTYPE_NAME(ap->type),
(i_wont_support & typemask(ap->type)) ?
"disabled" : "enabled");
+ }
return(1);
}