void test_script(int argc, char **argv);
void test_list_requests(void);
void test_version(int argc, char **argv);
+void test_krb5_auth(void);
void set_signal_handler(int, void (*handler)(int));
void set_signal_blocking(int, int);
else if (!strcmp(argv[0], "query") || !strcmp(argv[0], "qy"))
test_query(argc, argv);
else if (!strcmp(argv[0], "auth") || !strcmp(argv[0], "a"))
- test_auth();
+ test_krb5_auth();
else if (!strcmp(argv[0], "proxy") || !strcmp(argv[0], "p"))
test_proxy(argc, argv);
else if (!strcmp(argv[0], "access"))
quit = 1;
else if (!strcmp(argv[0], "version") || !strcmp(argv[0], "v"))
test_version(argc, argv);
+ else if (!strcmp(argv[0], "krb4_auth") || !strcmp(argv[0], "4"))
+ test_auth();
else
{
fprintf(stderr, "moira: Unknown request \"%s\". "
/* skip whitespace */
for (*p++ = '\0'; *p == ' ' || *p == '\t'; p++)
;
- if (*p && *p != '\n')
- argv[++argc] = p--;
+ if (*p && *p != '\n') {
+ if (++argc >= MAXARGS) {
+ fprintf(stderr,
+ "moira: Too many command line arguments\n");
+ return 0;
+ }
+ argv[argc] = p--;
+ }
}
}
if (*p == '\n')
com_err("moira (auth)", status, "");
}
+void test_krb5_auth(void)
+{
+ int status;
+
+ status = mr_krb5_auth("mrtest");
+ if (status)
+ com_err("moira (krb5_auth)", status, "");
+}
+
void test_proxy(int argc, char *argv[])
{
int status;
printf("host\t\t\tIdentify the server host\n");
printf("motd, m\t\t\tGet the Message of the Day\n");
printf("query, qy\t\tMake a query.\n");
- printf("auth, a\t\t\tAuthenticate to Moira.\n");
+ printf("auth, a\t\t\tAuthenticate to Moira via krb5.\n");
+ printf("krb4_auth, 4\t\tAuthenticate to Moira via krb4.\n");
printf("proxy, p\t\tProxy authenticate to Moira.\n");
printf("access\t\t\tCheck access to a Moira query.\n");
printf("dcm\t\t\tTrigger the DCM\n");