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.
{
register int x;
- if (strcasecmp(type, AUTHTYPE_NAME(0))) {
+ if (!strcasecmp(type, AUTHTYPE_NAME(0))) {
*maskp = -1;
return(1);
}
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);
}
printf("%s: invalid authentication type\n", type);
return(0);
}
- mask = getauthmask(type, &mask);
if (on)
i_wont_support &= ~mask;
else
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);
}